結果
| 問題 | No.3790 Unlabeled Slime Trees |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-22 12:23:38 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 380 ms / 2,000 ms |
| + 754µs | |
| コード長 | 471 bytes |
| 記録 | |
| コンパイル時間 | 2,267 ms |
| コンパイル使用メモリ | 343,256 KB |
| 実行使用メモリ | 10,488 KB |
| 最終ジャッジ日時 | 2026-11-06 20:58:10 |
| 合計ジャッジ時間 | 5,133 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/modint>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
vector<mint> ans = {1, 1, 1};
for (int n = 3; n <= 1e6; n++) {
ans.push_back(ans.back() * mint(2).pow(2 * n - 3) - mint(2).pow(3 * n - 7) - mint(2).pow(2 * n - 5) + mint(2).pow(n - 3));
}
int T; cin >> T;
while (T--) {
int N; cin >> N;
cout << ans[N].val() << '\n';
}
}