結果

問題 No.713 素数の和
ユーザー syunsukesyunsuke
提出日時 2018-07-17 00:13:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 7,988 KB
最終ジャッジ日時 2023-08-14 07:34:20
合計ジャッジ時間 985 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
7,764 KB
testcase_01 AC 26 ms
7,944 KB
testcase_02 AC 26 ms
7,804 KB
testcase_03 AC 26 ms
7,776 KB
testcase_04 AC 27 ms
7,988 KB
testcase_05 AC 26 ms
7,880 KB
testcase_06 AC 26 ms
7,832 KB
testcase_07 AC 26 ms
7,776 KB
testcase_08 AC 26 ms
7,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

list1=[2,3,5,7,11,13,17,19]
N=int(input())
for i in range(21,1000):
    count=0
    for j in range(3,int(i/2)+1):
        if i%j==0:
            count=1
            break
        else:
            j+=2
    if  count==0:
        list1.append(i)
    else:
        count=0
ans=0
for k in range(len(list1)):
    if N>=list1[k]:
        ans+=list1[k]
print(ans)
0