TDKPRIME - Finding the Kth Prime
The problem statement is really simple. There are some queries. You are to give the answers.
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.
Q lines with the answer of each query: the Kth prime number.
Input: 7 1 10 100 1000 10000 100000 1000000 Output: 2 29 541 7919 104729 1299709 15485863
sieve of erastothenes code gives time limit
having trouble see this explanation https://www.youtube.com/watch?v=-DHwP-oAV_0&list=PLN4aKSfpk8TQDJz7KLiwGFgnoUUwzfl1i&index=3&t=688s
can anyone share the solution in java!!???
For those who are asking how to find that there are 5 million primes under 90 million:
How do you guys know that there are 5 million primes under 90 million? I mean, is there any equation?
If any one have python code please share it
Used sieve of erastothenes solved in 1 go
how to guess the value of n, like under which we can generate 5million primes.Last edit: 2022-11-30 05:37:38
how can we solve it in python?
what java code will use? tried all attempt getting TLE/Sigterm
|Added by:||Alfonso² Peterssen|
|Cluster:||Cube (Intel G860)|
|Languages:||All except: ASM32 ASM64 BF CLPS LISP sbcl LISP clisp ERL HASK ICON ICK JS-RHINO LUA NEM NICE OBJC OCAML PHP PIKE PRLG-swi SCALA SCM guile SCM qobi ST SQLITE TCL WHITESPACE|
|Resource:||Thanks to TDuke|