結果
| 問題 | No.3790 Unlabeled Slime Trees |
| コンテスト | |
| ユーザー |
DeltaStruct
|
| 提出日時 | 2026-10-19 14:19:47 |
| 言語 | C++23(gnu拡張) (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 110 ms / 2,000 ms |
| + 940µs | |
| コード長 | 467 bytes |
| 記録 | |
| コンパイル時間 | 2,574 ms |
| コンパイル使用メモリ | 342,808 KB |
| 実行使用メモリ | 7,852 KB |
| 最終ジャッジ日時 | 2026-11-06 21:02:27 |
| 合計ジャッジ時間 | 4,129 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/modint>
using mint = atcoder::modint998244353;
array<mint,(int)1e6+1> dp;
int main(){
ios::sync_with_stdio(false),cin.tie(0);
mint t = 1,u = 2,inv2 = mint(1)/2;
for (int i(3);i <= 1e6;++i){
dp[i] = dp[i-1]*(u+u)*u;
dp[i] -= (t-1)*(u)*(u);
dp[i] += (u+1)*(u)*inv2-1;
t += t,u += u;
}
int q; cin >> q;
while(q--){
int n; cin >> n;
cout << (dp[n]+1).val() << '\n';
}
}
DeltaStruct