結果
| 問題 |
No.1737 One to N
|
| コンテスト | |
| ユーザー |
SidewaysOwl
|
| 提出日時 | 2021-11-12 21:48:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 43 ms / 2,000 ms |
| コード長 | 386 bytes |
| コンパイル時間 | 642 ms |
| コンパイル使用メモリ | 82,912 KB |
| 実行使用メモリ | 54,016 KB |
| 最終ジャッジ日時 | 2024-11-25 17:58:45 |
| 合計ジャッジ時間 | 2,341 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
from collections import defaultdict
def prime_factorization(w,d):
cnt = 2
while w > 1:
if cnt > int(w ** (1/2)):
d[w] += 1
break
while w % cnt == 0:
d[cnt] += 1
w //= cnt
cnt += 1
d = defaultdict(int)
n = int(input())
prime_factorization(n,d)
ans = 0
for key in d.keys():
ans += key * d[key]
print(ans)
SidewaysOwl