結果
| 問題 | No.713 素数の和 |
| コンテスト | |
| ユーザー |
_KingdomOfMoray
|
| 提出日時 | 2020-01-04 09:56:02 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 21 ms / 2,000 ms |
| + 232µs | |
| コード長 | 368 bytes |
| 記録 | |
| コンパイル時間 | 60 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2026-09-28 08:00:54 |
| 合計ジャッジ時間 | 1,254 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
ソースコード
import math
n = int(input())
list_num = list(range(1, n + 1))
list_num[0] = 0
for i in range(2, int(math.sqrt(n)) + 1):
if list_num[i - 1] == 0:
continue
multiple = 2
while True:
target = i * multiple
if target > n:
break
list_num[i * multiple - 1] = 0
multiple += 1
print(sum(list_num))
_KingdomOfMoray