結果

問題 No.3790 Unlabeled Slime Trees
コンテスト
ユーザー hiro1729
提出日時 2026-09-22 12:23:38
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 380 ms / 2,000 ms
+ 754µs
コード長 471 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 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
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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';
	}
}
0