Nth Prime Number

Please help me with finding the Nth prime number when N is very large(10^12).

I am also facing time limit exceeded issue

Can you Provide the Qn link ?

https://hack.codingblocks.com/contests/c/473

Actually constraints in this question is just <= 500000. SO you can find nth prime for this constraint using Sieve very easily .

Check this out, “Sieve of Eratosthenes”! Best algorithm to find Nth Prime Number :slightly_smiling_face:

https://www.geeksforgeeks.org/sieve-of-eratosthenes/