結果
問題 |
No.2816 At Most Two Moves
|
ユーザー |
|
提出日時 | 2024-07-19 23:04:24 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 283 bytes |
コンパイル時間 | 168 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 258,240 KB |
最終ジャッジ日時 | 2024-07-19 23:04:32 |
合計ジャッジ時間 | 7,684 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 TLE * 2 -- * 21 |
ソースコード
mod = 998244353 for _ in range(int(input())): N = int(input()) if N == 1: print(1) continue ans = 0 ans += (N + 1) * pow(2, N * (N - 1) // 2 - 1, mod) ans += pow(2, N * (N - 1) // 2 - (2 * N - 3)) * (N - 1) * (pow(4, N - 2, mod) - pow(3, N - 2, mod)) ans %= mod print(ans)