Primes Problem Spoj

Question:-https://www.spoj.com/problems/TDPRIMES/

Code link:-https://ide.codingblocks.com/s/382567

I don’t understand why it isn’t printing anything, Everything is correct.

hello @div_yanshu07 please see this code i have corrected it. prime sieve can be used till 1e7 only.


if you have any doubt you can ask here:
Happy Learning !!


Please, read the question. It’s still not printing all the primes.

hey @div_yanshu07 see this :


i think this will resolve your doubt.
Happy Learning !!


The code which you sent is still wrong and I corrected it. Now it’s printing the primes but not all.
Please, read the question. Question wants us to print 1,101,201,301th prime number. And you are incrementing the loop by 1.

hey @div_yanshu07 see this:
everycodde which i am sharing is working fine on my pc.


please check this.
Happy Learning!!

Nope the code that you were sending I tried submitting it was giving WA.

And you said the max array size can be 1e7 rt?
Then why 1e8 here??

yeah! it is giving wrong answer because you have to find 1e8 prime number as well.
but here we are finding prime numbers till 1e8 only.

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.