#P3912. 素数个数

    ID: 4629 远端评测题 2000ms 125MiB 尝试: 0 已通过: 0 显示难度普及− 上传者: 标签>数学枚举素数判断,质数,筛法

素数个数

Problem Description

Find the number of primes among 1,2,,N1, 2, \cdots, N.

Input Format

One line containing an integer NN.

Output Format

One line containing an integer, representing the number of primes.

10
4

Hint

For 40%40\% of the testdata, 1N1061 \le N \le 10^6.

For 80%80\% of the testdata, 1N1071 \le N \le 10^7.

For 100%100\% of the testdata, 1N1081 \le N \le 10^8.

Translated by ChatGPT 5