https://ide.codingblocks.com/s/52779
https://hack.codingblocks.com/contests/c/512/815
plz check my code , i m not getting any output. Also dont know if my code is correct.
https://ide.codingblocks.com/s/52779
https://hack.codingblocks.com/contests/c/512/815
plz check my code , i m not getting any output. Also dont know if my code is correct.
you doing is having a run time error.
in line 30 change a[k]>0 to a[k]> 1 you code will go infinite in case of 0
in line 31 condition will be allprime[i]<=a[k]
there are still more errors try to debug the code.
If(still doubt)
post_doubt()
else
hit_like 
Cheers!
it is still giving wrong answers for many cases.whats my mistake?
https://ide.codingblocks.com/s/52810
after computing answer for first query . you need to make frequency array values to 0. You are not clearing the frequency array.
Test case 
2
2
2 2
2
2 2
You are getting wrong answer.
Hit like if u get it
thanks a lot , it worked. My code works fine but now it shows run error on submitting.
i also optimised it a little but still giving run error.
plz reply…
check whether it is going array out of bound or not
i tried but couldn’t find. plz can u find it.
why u use N=10000 in your code?
its not giving output if i increase N
check how many primes are less than 10^6 and code according because you cant fix N=10000