結果
| 問題 | No.1659 Product of Divisors |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2021-08-28 01:45:58 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 616 bytes |
| 記録 | |
| コンパイル時間 | 227 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 152,436 KB |
| 最終ジャッジ日時 | 2024-11-21 09:10:10 |
| 合計ジャッジ時間 | 47,180 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 TLE * 15 |
ソースコード
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)
titia