結果

問題 No.713 素数の和
ユーザー ddsyg1ddsyg1
提出日時 2019-01-18 14:19:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 8,024 KB
最終ジャッジ日時 2023-09-20 03:44:11
合計ジャッジ時間 899 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,024 KB
testcase_01 AC 16 ms
7,868 KB
testcase_02 AC 17 ms
8,008 KB
testcase_03 AC 17 ms
7,952 KB
testcase_04 AC 17 ms
7,868 KB
testcase_05 AC 17 ms
7,844 KB
testcase_06 AC 16 ms
7,964 KB
testcase_07 AC 17 ms
7,904 KB
testcase_08 AC 17 ms
7,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

a = int(input())
b = []
for x in range(a+1):
	if is_prime(x) == True:
		b.append(x)

print(sum(b))
0