結果

問題 No.2816 At Most Two Moves
ユーザー nikoro256
提出日時 2025-02-09 18:06:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 180 bytes
コンパイル時間 581 ms
コンパイル使用メモリ 82,292 KB
実行使用メモリ 66,908 KB
最終ジャッジ日時 2025-02-09 18:06:59
合計ジャッジ時間 3,361 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
p=998244353
for _ in range(T):
    N=int(input())
    ans=pow(2,N*(N-1)//2,p)+(N-1)*(pow(2,N*(N-1)//2,p)-pow(2,N*(N-1)//2-1-2*(N-2),p)*pow(3,N-2,p))
    print(ans%p)
0