Deepak and Primes

I am getting the following error while running the code.

Error !
Compiling failed with exitcode 4, compiler output:
sudo: unable to resolve host judge-worker-01
g++: internal compiler error: File size limit exceeded (program as)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.

My code is https://ide.codingblocks.com/s/193357

Hi @adarsh_anand https://ide.codingblocks.com/s/193364
I have changed the size of array according to constraints and also the datatype to long long int. Please mark your doubt as resolved if you are satisfied

Now I am getting a runtime error on 2 of the test cases.

@adarsh_anand https://ide.codingblocks.com/s/194084 please check now

Still getting the same error.

hi @adarsh_anand the constrainst say that n can be upto 5000000, so you have to modify the size of your sieve such that the 5000000th prime number can be accomodated.