結果

問題 No.1659 Product of Divisors
ユーザー ああいいああいい
提出日時 2022-03-05 11:30:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 791 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 85,604 KB
最終ジャッジ日時 2023-09-26 18:07:53
合計ジャッジ時間 5,924 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
85,460 KB
testcase_01 AC 139 ms
85,228 KB
testcase_02 AC 73 ms
71,228 KB
testcase_03 AC 136 ms
85,508 KB
testcase_04 AC 134 ms
85,132 KB
testcase_05 AC 132 ms
85,324 KB
testcase_06 AC 139 ms
85,500 KB
testcase_07 WA -
testcase_08 AC 136 ms
85,344 KB
testcase_09 AC 136 ms
85,472 KB
testcase_10 WA -
testcase_11 AC 135 ms
85,452 KB
testcase_12 AC 132 ms
85,532 KB
testcase_13 AC 71 ms
71,248 KB
testcase_14 AC 133 ms
85,104 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 132 ms
85,156 KB
testcase_18 AC 135 ms
85,396 KB
testcase_19 AC 137 ms
85,384 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 133 ms
85,532 KB
testcase_24 AC 134 ms
85,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if N == 1:
    print(1)
    exit()

C = 10 ** 6
dat = [0] * C
from collections import defaultdict
d = defaultdict(int)
for i in range(2,C):
    if dat[i] == 0:
        for j in range(2 * i,C,i):
            dat[j] = 1
        if N % i == 0:
            while N % i == 0:
                N //= i
                d[i] += 1
P = 10 ** 9 + 7
fact = [1] * 100
fact_inv = [1] * 100
for i in range(2,100):
    fact[i] = fact[i-1] * i % P
fact_inv[-1] = pow(fact[-1],P-2,P)
for i in range(98,0,-1):
    fact_inv[i] = fact_inv[i+1] * (i + 1) % P
ans = 1
def h(n,k):
    ans = 1
    u = n + k -1
    for i in range(n):
        ans = ans * (u - i) % P
    ans = ans * fact_inv[n] % P
    return ans
for v in d.values():
    ans = ans * h(v,K+1) % P
print(ans)
0