結果

問題 No.1659 Product of Divisors
ユーザー Kude
提出日時 2021-08-27 21:40:27
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-21 01:17:48
合計ジャッジ時間 1,906 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0