結果

問題 No.1973 Divisor Sequence
ユーザー nok0nok0
提出日時 2021-08-21 12:13:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 663 bytes
コンパイル時間 1,837 ms
コンパイル使用メモリ 208,484 KB
実行使用メモリ 100,968 KB
最終ジャッジ日時 2023-10-21 04:43:13
合計ジャッジ時間 4,897 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 83 ms
25,528 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 91 ms
20,388 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 48 ms
12,076 KB
testcase_15 AC 123 ms
22,024 KB
testcase_16 AC 113 ms
26,060 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 130 ms
100,968 KB
testcase_24 AC 226 ms
38,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#include <atcoder/modint>
using mint = atcoder::modint1000000007;

#define rep(i, x) for(int i = 0; i < (x); i++)
using ll = long long;

mint res = 1;

int main() {
	int n;
	ll m;
	cin >> n >> m;
	int lim = sqrt(m);
	for(int i = 2; i <= lim; i++) {
		int c = 0;
		while(m % i == 0) m /= i, c++;
		if(c) {
			vector dp(n + 1, vector(c + 1, mint(0)));
			dp[0][0] = 1;
			for(int i = 0; i < n; i++) {
				mint cum = 0;
				for(int j = c; j >= 0; j--) {
					cum += dp[i][c - j];
					dp[i + 1][j] = cum;
				}
			}
			res *= accumulate(dp.back().begin(), dp.back().end(), mint(0));
		}
	}
	cout << res.val() << endl;
}
0