← 返回 nvidia 的题目列表Find the N-th Prime Number
类型:online_judge
Given a positive integer n, return the n-th prime number. A prime is an integer greater than 1 that has no positive divisors other than 1 and itself.
I/O format:
Input: an integer n
Output: the n-th prime number
Constraints:
1 <= n <= 100000
Requirements:
Must run in reasonable time up to n = 100000.
State your time complexity.
Examples:
Input: 1, Output: 2
Input: 5, Output: 11
Sample tests (stdin/stdout):
Input
1
Output
2
Input
5
Output
11
Input
10
Output
29
Input
100
Output
541
Input
1000
Output
7919
Example
Input
1
Output
2