結果
| 問題 | No.713 素数の和 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-10 20:40:05 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 2,000 ms |
| コード長 | 350 bytes |
| 記録 | |
| コンパイル時間 | 347 ms |
| コンパイル使用メモリ | 85,448 KB |
| 実行使用メモリ | 62,068 KB |
| 最終ジャッジ日時 | 2026-04-15 06:38:39 |
| 合計ジャッジ時間 | 1,583 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
ソースコード
from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline
N = int(input())
flg = [False]*(N+1)
ans = 0
if N==1:
print(0)
exit()
for i in range(2,N+1):
if flg[i]:
continue
ans += i
for j in range(i,N+1,i):
flg[j] = True
print(ans)