Deepak and Primes

hi, please have a look.
it is showing core dumped


thanks

try this code
this is optimised one

thanks for the code.Pls explain why my code was throwing core dumped because the same approach is being taught in the video. Thanks

@vatsal50,
When declaring array/vectors of large sizes, like here, declare them globally.

will it create any difference?

@vatsal50,
I think yes, otherwise I wouldn’t have recommended I guess.

actually I want to know why my code failed because I have used same approach as taught.
thnks

hi, the code that u sent is throwing TLE

pls help with the same

@vatsal50,
I didn’t send any code, I just recommended improvements in your code.
@asaurabh_26 had send that code, I think he would know better how it works, tag him and lets wait for his reply.

ok . I was unaware of that. I am sorry

actually the code i have provide is correct and passing all testcases till few day back

i think there is some error with checker i will update you about this

try some new questions till then

happy Learning :grinning:

actually the constraints are changed now

Now N is <= 500000
Nth prime number will be smaller than 7400000
hence Run your loop till 7400000