Why do I get runtime error?

I was practicing the question : Product of divisors and I encountered this error: Runtime Error. I read the FAQs regarding this issue and found that this error could be due to following:

  1. Division by zero
  2. Due too much memory usage

My submission page shows that my program using 2.6M of memory and takes 0.01 time but I still get this error. Why?

share your code link

which type of error you are getting

@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.

1. Start
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
13. Stop

Well, then again if you fail, then have a look at this tutorial. Good Luck!

Please enlighten me on the use of vectors.

Try going through these links:

  1. http://www.mochima.com/tutorials/vectors.html
  2. http://www.cplusplus.com/reference/vector/vector/
  3. http://stackoverflow.com/questions/6462985/c-stl-vector-vs-array-in-the-real-world
    And this tutorial:
  4. http://www.dreamincode.net/forums/topic/33631-c-vector-tutorial/

This should get you started, at least.