Number of divisors@no output

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 :stuck_out_tongue:

Cheers!

1 Like

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 :slight_smile:
2
2
2 2
2
2 2

You are getting wrong answer.

Hit like if u get it

1 Like

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.

https://ide.codingblocks.com/s/53332

plz reply…

check whether it is going array out of bound or not

1 Like

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