@buzzinga >> Your approach is wrong. And you need to learn again how to use vectors in C++, as obvious from your submissions to the mentioned problem.
The following is the algorithm for the problem. Read it, and try to code again.
2. Precompute all primes below 500000
3. Precompute what numbers below 500000 are perfect squares and their squareroots
4. Take in number of test cases
5. While there exists a test case we have not processed
6. Take in the number.
7. Find the number of divisors.
8. Calculate the answer using the formulae we derived.
9. Take the remainder with 10000 while calculating the answers.
10. Take care to make sure that we print the last 4 digits correctly with necessary number of 0s.
11. Simply taking modulo 10000 will not work.
12. Print the answer
Well, then again if you fail, then have a look at this tutorial. Good Luck!