結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,816 KB
testcase_02 AC 2 ms
6,816 KB
testcase_03 AC 11 ms
6,940 KB
testcase_04 AC 11 ms
6,940 KB
testcase_05 AC 10 ms
6,940 KB
testcase_06 AC 8 ms
6,944 KB
testcase_07 AC 8 ms
6,940 KB
testcase_08 AC 10 ms
6,940 KB
testcase_09 AC 11 ms
6,940 KB
testcase_10 AC 6 ms
6,944 KB
testcase_11 AC 8 ms
6,940 KB
testcase_12 AC 5 ms
6,944 KB
testcase_13 AC 364 ms
14,720 KB
testcase_14 AC 365 ms
14,720 KB
testcase_15 AC 367 ms
14,720 KB
testcase_16 AC 360 ms
14,720 KB
testcase_17 AC 367 ms
14,720 KB
testcase_18 AC 365 ms
14,848 KB
testcase_19 AC 372 ms
14,720 KB
testcase_20 AC 367 ms
14,592 KB
testcase_21 AC 371 ms
14,720 KB
testcase_22 AC 373 ms
14,720 KB
testcase_23 AC 374 ms
14,720 KB
testcase_24 AC 368 ms
14,720 KB
testcase_25 AC 361 ms
14,592 KB
testcase_26 AC 362 ms
14,592 KB
testcase_27 AC 361 ms
14,592 KB
testcase_28 AC 368 ms
14,720 KB
testcase_29 AC 309 ms
14,720 KB
testcase_30 AC 315 ms
14,720 KB
testcase_31 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using V=vector<atcoder::modint998244353>;
int main(){
 size_t 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(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