Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

PRIME GENERATOR(PRIME1) NZEC. please help

$
0
0

I have used the Sieve of Eratosthenes to sole this problem but i don't know how to handle the large numbers(1*10^9).It works fine for lower values but for larger ones, such as: 1 99990011 1000000000 I get this exception: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at roughwork.main(roughwork.java:19) What are the necessary corrections that has to be made in my code?

Here is my code: http://www.codechef.com/viewsolution/2313065 Thank you.


Viewing all articles
Browse latest Browse all 39796

Trending Articles