結果
| 問題 |
No.1737 One to N
|
| コンテスト | |
| ユーザー |
gr1msl3y
|
| 提出日時 | 2021-11-12 21:26:23 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 2,000 ms |
| コード長 | 478 bytes |
| コンパイル時間 | 222 ms |
| コンパイル使用メモリ | 82,220 KB |
| 実行使用メモリ | 53,512 KB |
| 最終ジャッジ日時 | 2024-11-25 12:01:22 |
| 合計ジャッジ時間 | 2,051 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
N = int(input())
if N == 1:
print(0)
exit()
def factorization(n):
if n == 1:
return [[1, 1]]
temp = n
ans = []
for i in range(2, int(n**0.5+1.01)):
if temp % i == 0:
ct = 0
while temp % i == 0:
temp //= i
ct += 1
ans.append([i, ct])
if temp != 1:
ans.append([temp, 1])
return ans
d = factorization(N)
ans = 0
for p, c in d:
ans += p*c
print(ans)
gr1msl3y