結果

問題 No.1659 Product of Divisors
ユーザー 👑 timitimi
提出日時 2021-09-14 09:43:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 627 bytes
コンパイル時間 1,046 ms
コンパイル使用メモリ 86,680 KB
実行使用メモリ 75,664 KB
最終ジャッジ日時 2023-09-09 05:08:31
合計ジャッジ時間 4,237 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,548 KB
testcase_01 AC 76 ms
75,488 KB
testcase_02 AC 74 ms
71,020 KB
testcase_03 AC 73 ms
71,348 KB
testcase_04 AC 88 ms
75,448 KB
testcase_05 AC 83 ms
75,664 KB
testcase_06 AC 76 ms
75,432 KB
testcase_07 AC 77 ms
75,492 KB
testcase_08 AC 91 ms
75,452 KB
testcase_09 AC 93 ms
75,472 KB
testcase_10 AC 90 ms
75,252 KB
testcase_11 AC 92 ms
75,304 KB
testcase_12 AC 92 ms
75,392 KB
testcase_13 AC 75 ms
71,184 KB
testcase_14 AC 92 ms
75,340 KB
testcase_15 AC 77 ms
75,384 KB
testcase_16 AC 77 ms
75,420 KB
testcase_17 AC 78 ms
75,396 KB
testcase_18 AC 78 ms
75,340 KB
testcase_19 AC 76 ms
75,448 KB
testcase_20 AC 85 ms
75,420 KB
testcase_21 AC 87 ms
75,280 KB
testcase_22 AC 87 ms
75,332 KB
testcase_23 AC 90 ms
75,464 KB
testcase_24 AC 83 ms
75,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int, input().split())
mod=10**9+7
if N==1:
  print(1)
  exit()
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
A=factorization(N) 
#print(A)
ans=1
for a,b in A:
  cnt=1
  d=1
  #素因数aをi回使い、分配するとき
  for i in range(1,b+1):
    d*=(K+i-1)
    d//=(i)
    cnt+=d
  ans*=cnt
  ans%=mod
print(ans)
0