結果

問題 No.1973 Divisor Sequence
ユーザー 沙耶花沙耶花
提出日時 2022-06-10 21:27:58
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 529 ms / 2,000 ms
コード長 740 bytes
コンパイル時間 4,691 ms
コンパイル使用メモリ 269,260 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 06:17:12
合計ジャッジ時間 6,934 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 59 ms
4,348 KB
testcase_03 AC 6 ms
4,348 KB
testcase_04 AC 35 ms
4,348 KB
testcase_05 AC 17 ms
4,348 KB
testcase_06 AC 37 ms
4,348 KB
testcase_07 AC 11 ms
4,348 KB
testcase_08 AC 20 ms
4,348 KB
testcase_09 AC 31 ms
4,348 KB
testcase_10 AC 39 ms
4,348 KB
testcase_11 AC 6 ms
4,348 KB
testcase_12 AC 31 ms
4,348 KB
testcase_13 AC 11 ms
4,348 KB
testcase_14 AC 29 ms
4,348 KB
testcase_15 AC 52 ms
4,348 KB
testcase_16 AC 50 ms
4,348 KB
testcase_17 AC 34 ms
4,348 KB
testcase_18 AC 4 ms
4,348 KB
testcase_19 AC 44 ms
4,348 KB
testcase_20 AC 10 ms
4,348 KB
testcase_21 AC 45 ms
4,348 KB
testcase_22 AC 41 ms
4,348 KB
testcase_23 AC 529 ms
4,348 KB
testcase_24 AC 147 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint1000000007;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001

mint get(long long N,int t){
	vector<mint> dp(t+1,0);
	dp[0] = 1;
	rep(i,N){
		vector<mint> ndp(t+1,0);
		rep(j,t+1){
			rep(k,t+1){
				if(j+k>t)break;
				ndp[k] += dp[j];
			}
		}
		swap(dp,ndp);
	}
	mint ret = 0;
	rep(i,t+1)ret += dp[i];
	return ret;
}

int main(){
	long long n,m;
	cin>>n>>m;
	
	map<long long,int> mp;
	for(long long i=2;i*i<=m;i++){
		while(m%i==0){
			mp[i]++;
			m/=i;
		}
	}
	if(m>1)mp[m]++;
	
	mint ans = 1;
	for(auto a:mp){
		ans *= get(n,a.second);
	}
	cout<<ans.val()<<endl;
	
	
    return 0;
}
0