結果

問題 No.713 素数の和
ユーザー utsumidaisukeutsumidaisuke
提出日時 2018-12-19 21:26:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 11,816 KB
実行使用メモリ 10,092 KB
最終ジャッジ日時 2023-10-26 00:06:39
合計ジャッジ時間 1,409 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
10,092 KB
testcase_01 AC 88 ms
10,092 KB
testcase_02 AC 83 ms
10,092 KB
testcase_03 AC 83 ms
10,092 KB
testcase_04 AC 83 ms
10,092 KB
testcase_05 AC 83 ms
10,092 KB
testcase_06 AC 87 ms
10,092 KB
testcase_07 AC 84 ms
10,092 KB
testcase_08 AC 84 ms
10,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

p = []

for i in range(2,1001):
    cnt = 0
    for j in range(1,i+1):
        if i%j == 0:
            cnt +=1
    if cnt == 2:
        p.append(i)


n = int(input())

ls = [i for i in p if i <= n]

sm = 0
for i in ls:
    sm += i
print(sm)
0