結果

問題 No.1659 Product of Divisors
ユーザー irumo8202irumo8202
提出日時 2022-02-07 10:37:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 681 bytes
コンパイル時間 682 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 75,984 KB
最終ジャッジ日時 2023-09-02 18:30:06
合計ジャッジ時間 5,007 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,656 KB
testcase_01 AC 80 ms
75,872 KB
testcase_02 WA -
testcase_03 AC 75 ms
71,756 KB
testcase_04 AC 91 ms
75,376 KB
testcase_05 AC 87 ms
75,656 KB
testcase_06 AC 81 ms
75,308 KB
testcase_07 AC 82 ms
75,528 KB
testcase_08 AC 95 ms
75,448 KB
testcase_09 AC 93 ms
75,400 KB
testcase_10 AC 95 ms
75,452 KB
testcase_11 AC 95 ms
75,984 KB
testcase_12 AC 95 ms
75,620 KB
testcase_13 WA -
testcase_14 AC 97 ms
75,520 KB
testcase_15 AC 81 ms
75,704 KB
testcase_16 AC 81 ms
75,932 KB
testcase_17 AC 78 ms
75,796 KB
testcase_18 AC 79 ms
75,624 KB
testcase_19 AC 78 ms
75,480 KB
testcase_20 AC 88 ms
75,452 KB
testcase_21 AC 90 ms
75,528 KB
testcase_22 AC 90 ms
75,532 KB
testcase_23 AC 92 ms
75,708 KB
testcase_24 AC 86 ms
75,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
MOD = 10 ** 9 + 7


def comb(n, k):
    ans = 1
    for i in range(1, k + 1):
        ans *= (n - i + 1) * pow(i, MOD - 2, MOD)
        ans %= MOD
    return ans


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-(n ** 0.5) // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


facts = factorization(N)

ans = 1
for p, e in facts:
    ans *= comb(K + e, e)
    ans %= MOD

print(ans)
0