[BOJ 9842] Prime

View as PDF

Submit solution

Points: 2
Time limit: 2.0s
Memory limit: 512M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. The first prime number is 2. Can you write a program that computes the nth prime number, given a number n ≤ 10000?

입력 형식

The input contains just one number which is the number n as described above. The maximum value of n is 10000.

출력 형식

The output consists of a single integer that is the nth prime number.

예제 입력

30

예제 출력

113

Comments

There are no comments at the moment.