a121. 質數又來囉
Tags : 區間問題 質數
Accepted rate: 8782人/ 11862人 ( 74%) [非即時]
評分方式:
Tolerant

最近更新 : 2011-05-06 18:43

Content
你的好朋友質數先生又來找你囉,給你兩個數字,請算出這兩個數字包含的範圍內有幾個質數。
Input

輸入兩個正整數a,b(1<=a<=b<=100000000)。

 保證b-a<=1000 

Output
輸出一個非負整數,代表a到b之間(包含a,b)總共有幾個質數。
Sample Input #1
3 7
6 6
30 50
Sample Output #1
3
0
5
測資資訊:
記憶體限制: 512 MB
公開 測資點#0 (100%): 3.0s , <1M
Hint :
Tags:
區間問題 質數
出處:
[管理者: VacationClub (雄中公假社) ]

Status Forum 排行

ID User Problem Subject Hit Post Date
41297 suyueh (suyueh) a121
python
1874 2024-07-16 15:42
49433 chen971023@g ... (ZiaynGZiyaNG) a121
小心TLE
417 2025-07-28 11:47
45311 algorithm_ap ... (欧几里得) a121
758 2025-02-12 22:33
53154 11115121@gs. ... (資訊甲_21) a121
284 2025-09-02 01:27
49194 bob981115@gm ... (Bob) a121
python 0.2s 5.3MB
248 2025-07-24 00:02