結果

問題 No.1659 Product of Divisors
ユーザー KudeKude
提出日時 2021-08-27 21:40:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 52 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,532 KB
実行使用メモリ 59,468 KB
最終ジャッジ日時 2024-05-01 02:00:41
合計ジャッジ時間 2,060 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,616 KB
testcase_01 AC 41 ms
58,192 KB
testcase_02 AC 38 ms
52,068 KB
testcase_03 AC 38 ms
52,516 KB
testcase_04 AC 37 ms
52,660 KB
testcase_05 AC 38 ms
52,744 KB
testcase_06 AC 38 ms
52,656 KB
testcase_07 AC 41 ms
57,748 KB
testcase_08 AC 39 ms
52,872 KB
testcase_09 AC 41 ms
53,028 KB
testcase_10 AC 49 ms
59,068 KB
testcase_11 AC 39 ms
52,772 KB
testcase_12 AC 38 ms
54,136 KB
testcase_13 AC 39 ms
53,544 KB
testcase_14 AC 39 ms
53,332 KB
testcase_15 AC 42 ms
57,236 KB
testcase_16 AC 41 ms
57,464 KB
testcase_17 AC 38 ms
53,136 KB
testcase_18 AC 39 ms
52,652 KB
testcase_19 AC 39 ms
52,724 KB
testcase_20 AC 42 ms
58,036 KB
testcase_21 AC 43 ms
57,912 KB
testcase_22 AC 52 ms
59,416 KB
testcase_23 AC 41 ms
58,128 KB
testcase_24 AC 43 ms
59,468 KB
権限があれば一括ダウンロードができます

ソースコード

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