結果

問題 No.1659 Product of Divisors
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-08-28 08:17:41
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 606 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 247,992 KB
最終ジャッジ日時 2024-05-01 15:13:19
合計ジャッジ時間 13,988 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 501 ms
245,960 KB
testcase_01 AC 487 ms
247,048 KB
testcase_02 AC 477 ms
246,356 KB
testcase_03 AC 481 ms
246,976 KB
testcase_04 AC 477 ms
245,944 KB
testcase_05 AC 489 ms
246,812 KB
testcase_06 AC 475 ms
247,508 KB
testcase_07 AC 487 ms
247,200 KB
testcase_08 AC 503 ms
246,476 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 491 ms
246,628 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 486 ms
247,292 KB
testcase_23 RE -
testcase_24 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

### for bigger prime 
fact = [1,1]
finv = [1,1]
inv = [0,1]
 
for i in range(2,2*10**6+5):
    fact.append((fact[-1]*i)%mod)
    inv.append((inv[mod%i]*(mod-mod//i))%mod)
    finv.append((finv[-1]*inv[-1])%mod)
 
def nCr(n,r,mod):
    if r > n:
        return 0
    else: 
        return fact[n]*finv[r]%mod*finv[n-r]%mod


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
    ans *= nCr(count+k,k,mod)
    ans %= mod
if n != 1:
    ans *= k+1
    ans %= mod
print(ans)
0