結果
| 問題 |
No.713 素数の和
|
| コンテスト | |
| ユーザー |
_shota_224_
|
| 提出日時 | 2018-07-13 22:36:01 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 465 bytes |
| コンパイル時間 | 315 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-10-09 05:19:12 |
| 合計ジャッジ時間 | 1,121 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 WA * 1 |
ソースコード
import copy
N = int(input())
sosu = [2]
nums = list(range(3,N+1,2))
while 1:
tmp = copy.deepcopy(nums)
if len(nums)==0:
break
sosu.append(nums[0])
div = nums[0]
for i in range(len(nums)):
try:
if nums[i]%div==0:
nums.pop(i)
i-=1
except IndexError:
break
if tmp==nums:
break
if N==1:
print(0)
elif N==2:
print(1)
else:
print(sum(sosu)+sum(nums))
_shota_224_