結果
| 問題 | No.1659 Product of Divisors |
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2021-08-27 21:40:12 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 2,000 ms |
| コード長 | 426 bytes |
| 記録 | |
| コンパイル時間 | 412 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 57,728 KB |
| 最終ジャッジ日時 | 2026-05-15 07:13:54 |
| 合計ジャッジ時間 | 2,032 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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