提出 #70658240


ソースコード 拡げる

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
//using mint = modint1000000007;
//const int mod = 1000000007;
using mint = modint998244353;
const int mod = 998244353;
//const int INF = 1e9;
//const long long LINF = 1e18;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i,l,r)for(int i=(l);i<(r);++i)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; --i)
#define rrep2(i,l,r)for(int i=(r) - 1;i>=(l);--i)
#define all(x) (x).begin(),(x).end()
#define allR(x) (x).rbegin(),(x).rend()
#define P pair<int,int>
template<typename A, typename B> inline bool chmax(A & a, const B & b) { if (a < b) { a = b; return true; } return false; }
template<typename A, typename B> inline bool chmin(A & a, const B & b) { if (a > b) { a = b; return true; } return false; }

#include <vector>
#include <atcoder/all>
// Π(1+A_i x)のFFT
std::vector<mint> divideConquerFFT(const std::vector<int> &a, int l, int r) {
	if (r == l)return { 1 };
	if (r - l == 1) return { 1, a[l] };
	int m = (l + r) / 2;
	return atcoder::convolution(divideConquerFFT(a, l, m), divideConquerFFT(a, m, r));
}
int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	int n, k; cin >> n >> k;
	vector<int>a(n);
	rep(i, n)cin >> a[i];
	auto ans = divideConquerFFT(a, 0, n);
	ans.resize(k + 1);
	cout << ans[k].val() << endl;
	return 0;
}

提出情報

提出日時
問題 I - スコア
ユーザ kwm_t
言語 C++ 23 (gcc 12.2)
得点 3
コード長 1407 Byte
結果 AC
実行時間 135 ms
メモリ 8712 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 3 / 3
結果
AC × 2
AC × 7
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt
All 00_sample_00.txt, 00_sample_01.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 02_min_00.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3460 KiB
00_sample_01.txt AC 1 ms 3596 KiB
01_random_00.txt AC 135 ms 8632 KiB
01_random_01.txt AC 69 ms 5924 KiB
01_random_02.txt AC 130 ms 8584 KiB
01_random_03.txt AC 134 ms 8712 KiB
02_min_00.txt AC 1 ms 3396 KiB