結果
問題 |
No.888 約数の総和
|
ユーザー |
|
提出日時 | 2020-08-16 14:57:29 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 56 ms / 2,000 ms |
コード長 | 465 bytes |
コンパイル時間 | 89 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-10-11 10:28:35 |
合計ジャッジ時間 | 2,400 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
from collections import Counter def prime_factorize(n): a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) return a N = int(input()) P = Counter(prime_factorize(N)) ans = 1 for n,K in P.items(): count = 0 for k in range(K+1): count += n**k ans *= count print(ans)