結果
| 問題 |
No.713 素数の和
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-07-28 16:17:17 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 2,000 ms |
| コード長 | 268 bytes |
| コンパイル時間 | 123 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2024-07-05 20:17:55 |
| 合計ジャッジ時間 | 685 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
ソースコード
def mark(s, x):
for i in xrange(x + x, len(s), x):
s[i] = False
def sieve(n):
s = [True] * n
for x in xrange(2, int(n**0.5) + 1):
if s[x]: mark(s, x)
return [i for i in xrange(0,n) if s[i] and i > 1]
print sum(sieve(int(input())+1))