結果

問題 No.1973 Divisor Sequence
ユーザー たたき@競プロ
提出日時 2023-08-11 15:38:38
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 861 bytes
コンパイル時間 5,032 ms
コンパイル使用メモリ 311,160 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-18 09:09:55
合計ジャッジ時間 6,591 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using mint=modint1000000007;
using ll=long long;
using pp=pair<int,int>;
#define sr string 
#define vc vector
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define pb push_back
#define all(v) v.begin(),v.end()
#define pque priority_queue
#define bpc(a) __builtin_popcount(a)
int main(){
  int n; ll m; cin>>n>>m;
  vc<int>v;
  for(ll i=2;i*i<=m;i++)if(m%i==0){
    int t=0;
    while(m%i==0)m/=i,t++;
    v.pb(t);
  }
  if(m>1)v.pb(1);
  mint ans=1;
   for(int a:v){
    vc<mint>dp(a+1,0); dp[0]=1;
    rep(z,n){
      vc<mint>pre(a+1,0); swap(pre,dp);
      rep(i,a)pre[i+1]+=pre[i];
      rep(i,a+1)dp[i]=pre[a-i];
    }
    mint res=0;
    rep(i,a+1)res+=dp[i];
    ans*=res;
  }
 // for(int a:v)cout<<a<<' ';
  cout<<ans.val();
}
  
0