Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 10 ** 6 + 3 * 10 ** 5
- isPrime = [True] * (n + 1)
- isPrime[0] = isPrime[1] = False
- p = 2
- while p * p <= n:
- if isPrime[p]:
- for i in range(p * p, n+1, p):
- isPrime[i] = False
- p += 1
- k = int(input())
- p = 2
- while k > 0:
- if isPrime[p]:
- x = p
- k -= 1
- p += 1
- print(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement