結果

問題 No.713 素数の和
コンテスト
ユーザー utsumidaisuke
提出日時 2018-12-19 21:26:56
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 241 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 375 ms
コンパイル使用メモリ 20,576 KB
実行使用メモリ 15,356 KB
最終ジャッジ日時 2026-04-12 12:45:24
合計ジャッジ時間 2,416 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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