結果
| 問題 |
No.1839 Concatenation Matrix
|
| コンテスト | |
| ユーザー |
hitonanode
|
| 提出日時 | 2021-12-19 18:04:03 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 894 bytes |
| コンパイル時間 | 1,184 ms |
| コンパイル使用メモリ | 94,160 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-09-15 14:42:24 |
| 合計ジャッジ時間 | 7,548 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 TLE * 1 -- * 7 |
ソースコード
// 愚直 O(n^2)
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <iostream>
#include <vector>
using namespace std;
// #include <atcoder/modint>
// using mint = atcoder::modint998244353;
constexpr unsigned md = 998244353;
int main() {
cin.tie(nullptr), ios::sync_with_stdio(false);
int N;
cin >> N;
vector<unsigned> A(N), B(N + 1);
for (auto &a : A) {
int x;
cin >> x;
a = x;
}
A.push_back(0);
unsigned base = 10;
for (int iter = 0; iter < N - 1; ++iter) {
A[N] = A[0];
for (int i = 0; i < N; ++i) {
// B[i] = A[i] * base + A[i + 1];
B[i] = ((unsigned long long)A[i] * base + A[i + 1]) % md;
}
swap(A, B);
base = (unsigned long long)base * base % md;
}
A.pop_back();
for (auto a : A) cout << a << '\n';
}
hitonanode