結果
| 問題 |
No.713 素数の和
|
| コンテスト | |
| ユーザー |
_KingdomOfMoray
|
| 提出日時 | 2020-01-04 09:56:02 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 2,000 ms |
| コード長 | 368 bytes |
| コンパイル時間 | 212 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-11-22 20:04:46 |
| 合計ジャッジ時間 | 1,060 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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