結果
| 問題 |
No.1659 Product of Divisors
|
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2021-08-27 21:40:12 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 52 ms / 2,000 ms |
| コード長 | 426 bytes |
| コンパイル時間 | 276 ms |
| コンパイル使用メモリ | 82,376 KB |
| 実行使用メモリ | 59,248 KB |
| 最終ジャッジ日時 | 2024-11-21 01:17:38 |
| 合計ジャッジ時間 | 2,148 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
def factorize(x):
ret = []
p = 2
while p * p <= x:
cnt = 0
while x % p == 0:
x //= p
cnt += 1
if cnt:
ret.append((p, cnt))
p += 1
if x > 1:
ret.append((x, 1))
return ret
MOD = 10 ** 9 + 7
from math import comb
n, k = map(int, input().split())
ans = 1
for p, c in factorize(n):
ans *= comb(c + k, c)
ans %= MOD
print(ans)
Kude