結果
| 問題 |
No.713 素数の和
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-02-10 20:40:05 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 47 ms / 2,000 ms |
| コード長 | 350 bytes |
| コンパイル時間 | 273 ms |
| コンパイル使用メモリ | 82,160 KB |
| 実行使用メモリ | 61,464 KB |
| 最終ジャッジ日時 | 2024-09-28 17:17:21 |
| 合計ジャッジ時間 | 1,351 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)