結果

問題 No.1659 Product of Divisors
ユーザー 👑 tamatotamato
提出日時 2021-08-27 21:38:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 872 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 87,612 KB
実行使用メモリ 75,864 KB
最終ジャッジ日時 2023-08-13 08:16:40
合計ジャッジ時間 3,279 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,652 KB
testcase_01 AC 75 ms
75,864 KB
testcase_02 AC 74 ms
71,724 KB
testcase_03 AC 73 ms
71,784 KB
testcase_04 AC 72 ms
71,472 KB
testcase_05 AC 73 ms
71,464 KB
testcase_06 AC 76 ms
75,684 KB
testcase_07 AC 78 ms
75,760 KB
testcase_08 AC 73 ms
71,636 KB
testcase_09 AC 74 ms
71,512 KB
testcase_10 AC 93 ms
75,776 KB
testcase_11 AC 74 ms
71,768 KB
testcase_12 AC 73 ms
71,780 KB
testcase_13 AC 73 ms
71,748 KB
testcase_14 AC 72 ms
71,464 KB
testcase_15 AC 75 ms
75,520 KB
testcase_16 AC 76 ms
75,768 KB
testcase_17 AC 77 ms
75,668 KB
testcase_18 AC 76 ms
75,768 KB
testcase_19 AC 75 ms
75,676 KB
testcase_20 AC 83 ms
75,852 KB
testcase_21 AC 87 ms
75,752 KB
testcase_22 AC 86 ms
75,804 KB
testcase_23 AC 75 ms
75,688 KB
testcase_24 AC 84 ms
75,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    def PrimeDecomposition(N):
        ret = {}
        n = int(N ** 0.5)
        for d in range(2, n + 1):
            while N % d == 0:
                if d not in ret:
                    ret[d] = 1
                else:
                    ret[d] += 1
                N //= d
            if N == 1:
                break
        if N != 1:
            ret[N] = 1
        return ret

    N, K = map(int, input().split())

    upper = [1] * 51
    lower = [1] * 51
    for i in range(50):
        upper[i+1] = (upper[i] * (K + i + 1))%mod
        lower[i+1] = (lower[i] * (i + 1))%mod

    P = PrimeDecomposition(N)
    ans = 1
    for p in P:
        x = P[p]
        ans = (ans * upper[x] * pow(lower[x], mod-2, mod))%mod
    print(ans)


if __name__ == '__main__':
    main()
0