My ans is coming out to be correct on compiling but the testcases are failing. Please help me with my code.
Deepak and Prateek - Testcases are failing
hello @Anaghajain
ur sieve size is not large enough to accomodate all required prime number.
first check what is value of 500 000 th prime number (use internet) ,and then declare ur sieve size greater than that.
I tried to change int to ll but the error still persists. What should I do to increase the sieve size?
by sieve size i mean length of the array.
The problem is still there. There is a segmentation fault occurring now.
check ur updated code .
a) changed the size of sieve array.
b) declared both vector and array as global (because global scope has higher memory capacity)
1 Like
Oh okay. Got it! Thank you very much! 