結果
問題 |
No.1839 Concatenation Matrix
|
ユーザー |
![]() |
提出日時 | 2021-12-19 17:56:43 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 607 bytes |
コンパイル時間 | 847 ms |
コンパイル使用メモリ | 91,704 KB |
実行使用メモリ | 12,192 KB |
最終ジャッジ日時 | 2024-09-15 14:42:13 |
合計ジャッジ時間 | 7,852 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 TLE * 1 -- * 7 |
ソースコード
// 愚直 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'; }