Deepak and Primes


2 test cases are showing wrong answer

hello @taritkandpal
ur sieve size is not big enough.
check value of 5000 000 th prime number and declare sieve of size just greater than that.

rest everything is correct in ur code.

check this code->

But even your code is showing time limit exceeded for n=10
This is happening when i use max_size as 86028122
if i use 1e7 then it is running normally

the code i shared is accepted solution,
may be now they have changed the time limit

yes
the code is working on DEV perfectly but not working on coding blocks ide

try again after sometime


I submitted your code directly and this is the result.

The problem is in the ide for sure

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.