Prateek loves candy

sir in this question number of primes are given and we are asked to print them.
My code is working on custom input but not passing all cases. please tell the error.

hello @tejuschaturvedi0

a) prepare ur sieve only upto 10^6 as in question they have said that value of prime number never exceed 10^6.

b) store all the prime number upto 10^6 in some array or vector
and then use that vector to answer each query in O(1)

refer this for clarity->

sir your code is not running . it is saying an error so please check it out.

…

the issue is with compiler. team is working on this issue,pls wait for sometime

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.