結果

問題 No.1659 Product of Divisors
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-08-28 08:27:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 407 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 82,232 KB
実行使用メモリ 59,656 KB
最終ジャッジ日時 2024-05-01 15:25:20
合計ジャッジ時間 2,066 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,868 KB
testcase_01 AC 38 ms
58,480 KB
testcase_02 AC 37 ms
52,544 KB
testcase_03 AC 37 ms
52,616 KB
testcase_04 AC 51 ms
58,056 KB
testcase_05 AC 45 ms
57,928 KB
testcase_06 AC 39 ms
59,020 KB
testcase_07 AC 38 ms
58,764 KB
testcase_08 AC 53 ms
58,184 KB
testcase_09 AC 53 ms
58,192 KB
testcase_10 AC 52 ms
57,936 KB
testcase_11 AC 53 ms
58,392 KB
testcase_12 AC 54 ms
57,764 KB
testcase_13 AC 36 ms
52,476 KB
testcase_14 AC 56 ms
59,656 KB
testcase_15 AC 39 ms
58,304 KB
testcase_16 AC 41 ms
58,412 KB
testcase_17 AC 38 ms
57,804 KB
testcase_18 AC 39 ms
58,912 KB
testcase_19 AC 37 ms
59,396 KB
testcase_20 AC 45 ms
58,844 KB
testcase_21 AC 50 ms
58,452 KB
testcase_22 AC 46 ms
57,740 KB
testcase_23 AC 51 ms
59,048 KB
testcase_24 AC 46 ms
58,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
mod = 10**9+7

ans = 1

for i in range(2,int(n**0.5)+1):
    if n%i:
        continue
    count = 0
    while n%i == 0:
        n //= i
        count += 1
    base = 1
    for i in range(count):
        ans *= count+k-i
        ans %= mod
        base *= i+1
        base %= mod
    ans *= pow(base,mod-2,mod)
    ans %= mod
if n != 1:
    ans *= k+1
    ans %= mod
print(ans)
0