結果
| 問題 |
No.1973 Divisor Sequence
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-06-11 01:07:14 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 370 ms / 2,000 ms |
| コード長 | 665 bytes |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 82,288 KB |
| 実行使用メモリ | 76,408 KB |
| 最終ジャッジ日時 | 2024-09-21 08:20:37 |
| 合計ジャッジ時間 | 4,157 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
import sys
input = sys.stdin.readline
N,M=map(int,input().split())
mod=10**9+7
x=M
# 素因数分解
import math
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(LEN,N):
DP=[1]*LEN
for tests in range(N-1):
NDP=[0]*LEN
for j in range(LEN):
NDP[LEN-1-j]+=DP[j]
DP=[0]*LEN
DP[-1]=NDP[-1]
for j in range(LEN-2,-1,-1):
DP[j]=DP[j+1]+NDP[j]
DP[j]%=mod
return sum(DP)%mod
ANS=1
for f in FACT.values():
ANS*=calc(f+1,N)
ANS%=mod
print(ANS)
titia