結果

問題 No.1068 #いろいろな色 / Red and Blue and more various colors (Hard)
ユーザー tktk_snsntktk_snsn
提出日時 2022-04-30 11:11:48
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,065 bytes
コンパイル時間 4,318 ms
コンパイル使用メモリ 116,028 KB
実行使用メモリ 49,864 KB
最終ジャッジ日時 2023-09-12 03:52:52
合計ジャッジ時間 13,722 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 13 ms
4,376 KB
testcase_04 AC 10 ms
4,376 KB
testcase_05 AC 11 ms
4,380 KB
testcase_06 AC 9 ms
4,380 KB
testcase_07 AC 8 ms
4,376 KB
testcase_08 AC 10 ms
4,376 KB
testcase_09 AC 12 ms
4,380 KB
testcase_10 AC 6 ms
4,380 KB
testcase_11 AC 8 ms
4,380 KB
testcase_12 AC 5 ms
4,380 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 384 ms
48,904 KB
testcase_30 AC 386 ms
48,016 KB
testcase_31 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <utility>
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b){ if (a < b){ a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b){ if (a > b){ a = b; return true; } return false; }

#include <atcoder/convolution>
#include <atcoder/modint>
using namespace atcoder;
using mint = modint998244353;



int main() {
    int N, Q; cin >> N >> Q;

    vector<vector<mint>> F;
    for(int i=0; i<N; ++i) {
        int a;
        scanf("%d", &a);
        vector<mint> x(2, 1);
        x[0] = a - 1;
        F.push_back(x);
    }

    int i = 0;
    while (i < F.size()) {
        if (i + 1 == F.size()) break;
        F.push_back(convolution(F[i], F[i+1]));
        i += 2;
    }

    auto G = F[F.size()-1];
    for(int j=0; j<Q; ++j) {
        int b; cin >> b;
        printf("%d\n", G[b].val());
    }
    return 0;
}
0