結果
問題 | No.1659 Product of Divisors |
ユーザー |
![]() |
提出日時 | 2021-08-27 22:01:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 54 ms / 2,000 ms |
コード長 | 614 bytes |
コンパイル時間 | 188 ms |
コンパイル使用メモリ | 82,356 KB |
実行使用メモリ | 59,908 KB |
最終ジャッジ日時 | 2024-11-21 02:23:44 |
合計ジャッジ時間 | 2,030 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
from _collections import defaultdict n,k=map(int,input().split()) dic=defaultdict(int) p=2 nod=n while p**2<=n: if nod%p==0: dic[p]+=1 nod//=p else: p+=1 if nod>1:dic[nod]+=1 ans=1 mod=10**9+7 def cnb(n,r): if n<0 or r<0 or r>n: return 0 res=1 res2=1 for i in range(1,r+1): res*=n-i+1 res%=mod res2*=i res2%=mod ans=res*pow(res2,mod-2,mod) ans%=mod return ans for p in dic: subans=0 for a in range(dic[p]+1): subans+=cnb(k-1+a,a) subans%=mod ans*=subans ans%=mod print(ans)