結果

問題 No.1839 Concatenation Matrix
ユーザー 👑 hitonanodehitonanode
提出日時 2021-12-19 17:56:43
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 607 bytes
コンパイル時間 1,465 ms
コンパイル使用メモリ 91,284 KB
実行使用メモリ 8,712 KB
最終ジャッジ日時 2023-10-13 18:56:08
合計ジャッジ時間 8,512 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 7 ms
4,352 KB
testcase_09 AC 16 ms
4,348 KB
testcase_10 AC 1,416 ms
4,352 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

// 愚直 O(n^2)
#include <iostream>
#include <vector>
using namespace std;

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

int main() {
    cin.tie(nullptr), ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<mint> A(N);
    for (auto &a : A) {
        int x;
        cin >> x;
        a = x;
    }
    A.push_back(0);
    mint base = 10;
    for (int iter = 0; iter < N - 1; ++iter) {
        A.back() = A[0];
        for (int i = 0; i < N; ++i) A[i] = A[i] * base + A[i + 1];
        base *= base;
    }

    A.pop_back();
    for (auto a : A) cout << a.val() << '\n';
}
0