← ~/문제
P2007

Count the Primes

Medium
// 문제 설명
Given an integer n, count how many prime numbers are less than or equal to n.
// 입력
A single integer n (1 <= n <= 10^6).
// 출력
The number of primes not greater than n.
// 힌트
A sieve of Eratosthenes counts all primes up to n in O(n log log n).
// 예제
입력 예제
10
출력 예제
4
// 문제 정보
난이도Medium
정답률80%
시간 제한1000 ms
메모리 제한65536 KB
정답8