Sieve of Primes
Submit solution
Points:
1
Time limit:
1.0s
Memory limit:
256M
Problem type
Allowed languages
C++, Python
Prime Counting Problem
Given a positive integer n, find the number of prime numbers between 1 and n (inclusive).
Input Format
A single line containing the integer n.
Output Format
A single integer — the number of primes ≤ n.
Data Range
1 ≤ n ≤ 106
Sample Input
8
Sample Output
4
Comments