1 / 6
Apr 2010

I've got WA everytime on PRIME1.
But I've tested my output for first 10^6 primes and it is correct.
I've using a double sieve algorithm.

SOLVED

I think I've error in output formatting. Can you help me with it?

Fixed it, but still got WA.

I've used this test case:

And looks like everything is fine, but it runs about 1 second before WA on spoj.

Obviously there is a problem in answer, not code errors, because if I catch all exceptions and then exit(100500) if one is catched I still got WA, not NZEC