結果
問題 | No.713 素数の和 |
ユーザー |
|
提出日時 | 2019-07-16 14:47:50 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 296 bytes |
コンパイル時間 | 72 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-11-30 14:15:32 |
合計ジャッジ時間 | 1,005 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
n = int(input())if n ==1:print(0)import syssys.exit()a = {i for i in range(2, n+1)}import mathq=set()while True:p=sorted(list(a.difference(q)))[0]if p > int(math.sqrt(n)):breakq.add(p)for i in range(2,n//p+1):a.discard(p*i)print(sum(a))