Nth prime number using Prime Sieve Doubt

Original Problem link: https://www.codechef.com/problems/PRMNUM

Hello I am trying to implement a Nth prime number code uing this -> https://ide.codingblocks.com/s/158381 approach

However i am failing for the given constraints n(1<=n<=100000).

Here are the original wordings :slight_smile:

I am able to pass the sameple test case but failing for original constraints

Rohit, I have made some changes in the code, try to submit now,


I have used array instead of vectors.

1 Like

Can you please explain the reason of setting n or a global max to 10000000 ?

ma’am i have just checked on some test cases on original problem i am getting a wrong answer.

I have set max as 1000000 for the max array size only…,. and can you pls tell wheather the code is giving runtime error or any other error , as i have checked the code and its running perfectly for the sample test case.

Hi ,
i mean the output for some test cases are wrong, if possible please check the origianl statement and try to submit the code here: https://www.codechef.com/problems/PRMNUM

Ok, I try to do that …