Can’t reduce my time limit for the question of the prime visits what should I do??
I’ve tried both 1D array and array list method but both of them are not satisfying the time limit and test case 2.
Can't reduce my time limit for the question of the prime visits what should I do?
Use seive for precomputing the primes elements upto 10^7. Then query in 0(1) time to get your solution accepted.
Can you please elaborate the solution for me.
please share your code
dry run your code for input
1
1 100
your code gives 34 whereas the answer should be 25
Use seive for precomputing the primes elements upto 10^7. Then query in 0(1) time to get your solution accepted.
Use seive for precomputing the primes elements upto 10^7. Then query in 0(1) time to get your solution accepted. *****ive got this answer partially , but i can’t yet reduce my time.