結果
問題 | No.1657 Sum is Prime (Easy Version) |
ユーザー |
![]() |
提出日時 | 2021-08-28 20:59:10 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 500 bytes |
コンパイル時間 | 431 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 278,900 KB |
最終ジャッジ日時 | 2024-11-21 21:20:23 |
合計ジャッジ時間 | 25,110 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 TLE * 1 |
other | AC * 9 WA * 5 RE * 1 TLE * 6 |
ソースコード
from bisect import bisect_left def eratosthenes(s, t): Prime = [] Data = [i+1 for i in range(1, t)] limit = t**0.5 while True: p = Data[0] if p > limit: Prime += Data Prime = Prime[bisect_left(Prime, s):] return Prime Prime.append(p) Data = [e for e in Data if e%p != 0] l, r = map(int, input().split()) P = eratosthenes(l, r) P += eratosthenes(2*l+1, 2*r+1) print(len(P))