how to approach https://hack.codingblocks.com/app/practice/1/388/problem , as we can make sieve up to 10^6 and the higher limit is 10^9 ???
Deepak and Primes 2
Hello @Bhavya_Goel You can solve this problem using segmented seive as it is given in the problem that the difference between the numbers will be less than 10^6
Here for your reference i am attaching the code:
if you have any doubt you can ask here;
Happy Learning!!
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.