Runtime Error!

Question-SPOJ.com - Problem TDKPRIME
My Solution-Coding Blocks IDE

Sorry, but i won’t be of much help in C++

1 Like

The error is because of array bounds.
The maximum size of vector primes is the total number of primes less than
5000001. But here you are required to find the 5000000th prime which is surely not possible.
Look at my code : ktN2u7 - Online C++0x Compiler & Debugging Tool - Ideone.com

1 Like

Re-read the constraints (and the problem)