TDKPRIME  Finding the Kth Prime
The problem statement is really simple. There are some queries. You are to give the answers.
Input
An integer stating the number of queries Q(equal to 50000), and Q lines follow, each containing one integer K between 1 and 5000000 inclusive.
Output
Q lines with the answer of each query: the Kth prime number.
Example
Input: 7 1 10 100 1000 10000 100000 1000000 Output: 2 29 541 7919 104729 1299709 15485863
hide comments
coding_geek1:
20210923 19:12:26
Those who are still getting TLE using the below mentioned constraints try using fastio 

mdminhaz:
20210806 20:38:35
bool is_prime[90000001];


vikassnwl:
20210801 19:38:38
n = 86028121


toocurious:
20210801 18:12:04
For those who are getting TLE with c++. Try using bool array instead of int array in sieve. 

akshat_19:
20210514 11:42:41
Codechef compiler showed 1.76 sec on given test cases yet I got AC. 

rajkarmakar97:
20210226 08:49:10
TLE .......why? 

amitroy3370:
20210123 13:20:35
can I get some suggestion for solve this problem with java. I access the memory with 99000001.but it show's the run time error 

ratnesh123:
20210108 08:05:58
can we solve this using python,it is giving TLE,any idea for this Last edit: 20210108 08:06:28 

abhishekjr:
20201202 14:42:59
Can we solve the problem using python??


princemishra:
20201015 11:53:51
use array of size 90000001 with type bool Last edit: 20201220 07:02:18 
Added by:  Alfonso² Peterssen 
Date:  20100406 
Time limit:  1.240s 
Source limit:  10000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM32 ASM64 BF CLPS LISP sbcl LISP clisp ERL HASK ICON ICK JSRHINO LUA NEM NICE OBJC OCAML PHP PIKE PRLGswi SCALA SCM qobi SCM guile ST SQLITE TCL WHITESPACE 
Resource:  Thanks to TDuke 