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
SangKuan:
20150718 18:07:12
in debug mode i use 2~3 second,but only use 0.77s in spoj,haha 

:.Mohib.::
20150706 22:29:28
Nice One :) Last edit: 20150706 22:30:54 

V Y:
20150624 09:42:10
Superb 'solution'. We don't have a formula. We don't need primality tests. What are we left with? Optimize 'space'. It will be enough but not optimal. Last edit: 20150624 09:45:01 

[Mayank Pratap]:
20150620 10:22:50
Optimised Sieve leads to AC :) Superb Problem... 

Ankit Sultana:
20150606 14:51:56
Awesome Problem!! 

Nitesh Tripathi:
20150604 21:41:49
Learned a lot from this problem :) 

i_am_looser:
20150525 08:09:27
bitwise optimized sieve...... AC ;) 

karan:
20150427 21:48:48
one of my favourite question <3 

Abhinandan Agarwal:
20150123 14:15:54
Used optimised sieve 

(Tjandra Satria Gunawan)(æ›¾æ¯…æ˜†):
20120719 16:11:29
Maybe you like to solve this problem: Binary Sequence of Prime Number

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 clisp LISP sbcl ERL HASK ICON ICK JSRHINO LUA NEM NICE OBJC OCAML PHP PIKE PRLGswi SCALA SCM guile SCM qobi ST SQLITE TCL WHITESPACE 
Resource:  Thanks to TDuke 