Toggle navigation
Bulletin
Problems
Submissions
Contests
Discuss
About
Rank
Sign in
Sign up
×
Close
Rejudge 公告
718
,
552
已新增測資並 rejudge
IOICamp 2024 題目公開!
連結
程式解題社網站
程式解題社網站
上線了!
550 . 篩質數
Submit
Status
Discussion / Solution
Ranklist
Back to Problems List
TopCoder
Caido
主唱太拼命了
User's AC Ratio
75.0% (
9/12
)
Submission's AC Ratio
41.7% (
10
/
24
)
Tags
Show solution-related tags
apcsc
apcsc-array
Description
給定一個正整數
N
,請問
1
∼
N
中有幾個質數?
Input Format
輸入有一行,第一行有一個正整數代表題目中的
N
。
2
≤
N
≤
10
7
Output Format
輸出有一行,包含一個正整數,代表
1
∼
N
中質數的數量。
Sample Input 1
copy
10
Sample Output 1
copy
4
Hints
Problem Source
Subtasks
No.
Testdata Range
Constraints
Score
1
0
範例測資
0
2
0~20
無額外限制
100
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
500
524288
65536
1
2
1
500
524288
65536
2
2
500
524288
65536
2
3
500
524288
65536
2
4
500
524288
65536
2
5
500
524288
65536
2
6
500
524288
65536
2
7
500
524288
65536
2
8
500
524288
65536
2
9
500
524288
65536
2
10
500
524288
65536
2
11
500
524288
65536
2
12
500
524288
65536
2
13
500
524288
65536
2
14
500
524288
65536
2
15
500
524288
65536
2
16
500
524288
65536
2
17
500
524288
65536
2
18
500
524288
65536
2
19
500
524288
65536
2
20
500
524288
65536
2
Submit
Back to Top