結果

問題 No.1659 Product of Divisors
ユーザー titiatitia
提出日時 2021-08-28 01:44:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 616 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 17,956 KB
最終ジャッジ日時 2024-05-01 06:48:29
合計ジャッジ時間 3,681 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
17,572 KB
testcase_01 AC 77 ms
10,880 KB
testcase_02 AC 32 ms
10,880 KB
testcase_03 AC 25 ms
10,880 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
import math 

N,K=map(int,input().split())
mod=10**9+7


x=N
L=int(math.sqrt(x))

FACT=dict()

for i in range(2,L+2):
    while x%i==0:
        FACT[i]=FACT.get(i,0)+1
        x=x//i

if x!=1:
    FACT[x]=FACT.get(x,0)+1

def calc(x):
    DP=[0]*(x+1)
    DP[-1]=1

    for i in range(K):
        NDP=[0]*(x+1)

        for j in range(x+1):
            if DP[j]!=0:
                for k in range(j+1):
                    NDP[k]+=DP[j]
                    NDP[k]%=mod
        DP=NDP

    return sum(DP)

ANS=1
for f in FACT:
    ANS*=calc(FACT[f])
    ANS%=mod

print(ANS%mod)
0