結果

問題 No.2600 Avator Height
ユーザー かもめのうでかもめのうで
提出日時 2024-01-13 14:11:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 576 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 79,044 KB
最終ジャッジ日時 2024-01-13 14:11:49
合計ジャッジ時間 17,446 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
62,712 KB
testcase_01 AC 548 ms
79,044 KB
testcase_02 AC 557 ms
79,044 KB
testcase_03 AC 554 ms
79,044 KB
testcase_04 AC 547 ms
79,044 KB
testcase_05 AC 546 ms
79,044 KB
testcase_06 AC 549 ms
79,044 KB
testcase_07 AC 551 ms
79,044 KB
testcase_08 AC 552 ms
79,044 KB
testcase_09 AC 560 ms
79,044 KB
testcase_10 AC 546 ms
79,044 KB
testcase_11 AC 561 ms
79,044 KB
testcase_12 AC 547 ms
79,044 KB
testcase_13 AC 549 ms
79,044 KB
testcase_14 AC 551 ms
79,044 KB
testcase_15 AC 557 ms
79,044 KB
testcase_16 AC 550 ms
79,044 KB
testcase_17 AC 557 ms
79,044 KB
testcase_18 AC 554 ms
79,044 KB
testcase_19 AC 576 ms
79,044 KB
testcase_20 AC 545 ms
79,044 KB
testcase_21 AC 550 ms
79,044 KB
testcase_22 AC 550 ms
79,044 KB
testcase_23 AC 552 ms
79,040 KB
testcase_24 AC 465 ms
78,920 KB
testcase_25 AC 509 ms
78,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

q = int(input())
mod = 998244353
r = [0]*(2*10**5)
e = [0]*(2*10**5)
r[0] = 1
r[1] = 1
e[0] = 1
e[1] = 3
for i in range(2, 2*10**5):
    r[i] = r[i-1]+r[i-2]
    r[i] %= mod
    e[i] = e[i-1]+e[i-2]
    e[i] %= mod

for _ in range(q):
    n = int(input())
    n -= 1
    rn = pow(r[n], 2, mod)
    en = pow(e[n], 2, mod)
    print(((5*rn)%mod-en)%mod)
0