結果

問題 No.1068 #いろいろな色 / Red and Blue and more various colors (Hard)
ユーザー keijakkeijak
提出日時 2022-01-01 17:27:33
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 423 ms / 3,500 ms
コード長 415 bytes
コンパイル時間 5,025 ms
コンパイル使用メモリ 266,732 KB
実行使用メモリ 14,848 KB
最終ジャッジ日時 2024-04-18 15:17:30
合計ジャッジ時間 14,266 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 13 ms
5,376 KB
testcase_04 AC 10 ms
5,376 KB
testcase_05 AC 12 ms
5,376 KB
testcase_06 AC 9 ms
5,376 KB
testcase_07 AC 8 ms
5,376 KB
testcase_08 AC 10 ms
5,376 KB
testcase_09 AC 12 ms
5,376 KB
testcase_10 AC 6 ms
5,376 KB
testcase_11 AC 8 ms
5,376 KB
testcase_12 AC 5 ms
5,376 KB
testcase_13 AC 413 ms
14,592 KB
testcase_14 AC 417 ms
14,720 KB
testcase_15 AC 415 ms
14,720 KB
testcase_16 AC 413 ms
14,720 KB
testcase_17 AC 414 ms
14,720 KB
testcase_18 AC 418 ms
14,720 KB
testcase_19 AC 418 ms
14,720 KB
testcase_20 AC 420 ms
14,592 KB
testcase_21 AC 416 ms
14,592 KB
testcase_22 AC 418 ms
14,720 KB
testcase_23 AC 415 ms
14,720 KB
testcase_24 AC 418 ms
14,592 KB
testcase_25 AC 416 ms
14,592 KB
testcase_26 AC 418 ms
14,720 KB
testcase_27 AC 416 ms
14,720 KB
testcase_28 AC 423 ms
14,592 KB
testcase_29 AC 359 ms
14,592 KB
testcase_30 AC 360 ms
14,848 KB
testcase_31 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using V=vector<atcoder::modint998244353>;
int main(){
 int N,Q;cin>>N>>Q;deque<V>q;
 for (long long i=0,a;i<N;++i)cin>>a,q.push_back(V{a-1,1});
 while(q.size()>1)q.push_back(atcoder::convolution(q[0],q[1])),q.back().resize(min<int>(size(q.back()),N+1)),q.pop_front(),q.pop_front();
 for (int i=0,b;i<Q;++i)cin>>b,cout<<q.front()[b].val()<<'\n';
}
0