結果

問題 No.713 素数の和
ユーザー lllllll88938494lllllll88938494
提出日時 2023-07-11 12:40:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 169 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 87,292 KB
実行使用メモリ 75,804 KB
最終ジャッジ日時 2023-10-11 03:51:00
合計ジャッジ時間 1,932 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
75,804 KB
testcase_01 AC 70 ms
71,660 KB
testcase_02 AC 74 ms
71,272 KB
testcase_03 AC 74 ms
75,616 KB
testcase_04 AC 75 ms
75,732 KB
testcase_05 AC 73 ms
75,660 KB
testcase_06 AC 70 ms
71,388 KB
testcase_07 AC 69 ms
71,420 KB
testcase_08 AC 73 ms
75,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n= int(input())
ans = [0] * (n+1)

for i in range(2,n+1):
	t = i+i
	while t <= n:
		ans[t] = 1 
		t += i
		
a = 0
for i in range(2,n+1):
	if ans[i] == 0:
		a+=i
print(a)
0