結果

問題 No.1659 Product of Divisors
ユーザー KudeKude
提出日時 2021-08-27 21:40:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 86,748 KB
実行使用メモリ 75,528 KB
最終ジャッジ日時 2023-08-13 08:20:18
合計ジャッジ時間 3,351 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,108 KB
testcase_01 AC 79 ms
75,228 KB
testcase_02 AC 75 ms
71,220 KB
testcase_03 AC 75 ms
71,168 KB
testcase_04 AC 77 ms
71,124 KB
testcase_05 AC 76 ms
71,448 KB
testcase_06 AC 74 ms
71,184 KB
testcase_07 AC 77 ms
75,332 KB
testcase_08 AC 75 ms
71,316 KB
testcase_09 AC 76 ms
71,092 KB
testcase_10 AC 86 ms
75,092 KB
testcase_11 AC 76 ms
71,284 KB
testcase_12 AC 76 ms
71,160 KB
testcase_13 AC 76 ms
71,152 KB
testcase_14 AC 74 ms
71,116 KB
testcase_15 AC 76 ms
75,268 KB
testcase_16 AC 78 ms
75,432 KB
testcase_17 AC 76 ms
71,220 KB
testcase_18 AC 74 ms
71,460 KB
testcase_19 AC 75 ms
71,076 KB
testcase_20 AC 79 ms
75,176 KB
testcase_21 AC 79 ms
75,280 KB
testcase_22 AC 88 ms
75,336 KB
testcase_23 AC 75 ms
75,092 KB
testcase_24 AC 77 ms
75,528 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