結果

問題 No.1737 One to N
コンテスト
ユーザー Shirotsume
提出日時 2021-10-14 23:27:27
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 354 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 821 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 54,144 KB
最終ジャッジ日時 2026-05-20 01:31:55
合計ジャッジ時間 3,157 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def prime_fact(N):
    from collections import defaultdict
    res=defaultdict(int)
    for i in range(2,int(N**0.5)+2):
        if N%i==0:
            while N%i==0:
                res[i]+=1
                N//=i
    if N!=1:
        res[N]+=1
    return res

n = int(input())
d = prime_fact(n)
ans = 0
for x, y in d.items():
    ans += x * y
print(ans)
0