結果
問題 | No.713 素数の和 |
ユーザー |
![]() |
提出日時 | 2020-06-24 21:12:06 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 353 bytes |
コンパイル時間 | 79 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-03 20:20:56 |
合計ジャッジ時間 | 928 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
N = int(input())def sieve(n):res = [True for _ in range(n + 1)]res[0] = Falseres[1] = Falsei = 2while i * i <= n:if res[i]:for j in range(i * 2, n + 1, i):res[j] = Falsei += 1return resS = sieve(N)res = 0for i in range(N + 1):if S[i]:res += iprint(res)