結果

問題 No.2600 Avator Height
ユーザー playerplayer
提出日時 2024-01-13 20:47:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 549 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 79,032 KB
最終ジャッジ日時 2024-01-13 20:47:19
合計ジャッジ時間 16,433 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
62,624 KB
testcase_01 AC 507 ms
79,032 KB
testcase_02 AC 536 ms
79,032 KB
testcase_03 AC 507 ms
79,032 KB
testcase_04 AC 511 ms
79,032 KB
testcase_05 AC 526 ms
79,032 KB
testcase_06 AC 514 ms
79,032 KB
testcase_07 AC 536 ms
79,028 KB
testcase_08 AC 508 ms
79,032 KB
testcase_09 AC 541 ms
79,032 KB
testcase_10 AC 520 ms
79,032 KB
testcase_11 AC 539 ms
79,032 KB
testcase_12 AC 503 ms
79,032 KB
testcase_13 AC 549 ms
79,032 KB
testcase_14 AC 506 ms
79,032 KB
testcase_15 AC 509 ms
79,032 KB
testcase_16 AC 510 ms
79,032 KB
testcase_17 AC 514 ms
79,032 KB
testcase_18 AC 535 ms
79,032 KB
testcase_19 AC 527 ms
79,032 KB
testcase_20 AC 533 ms
79,032 KB
testcase_21 AC 506 ms
79,032 KB
testcase_22 AC 537 ms
79,032 KB
testcase_23 AC 518 ms
79,032 KB
testcase_24 AC 475 ms
78,904 KB
testcase_25 AC 468 ms
79,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

q = int(input())
mod = 998244353

dpr = [0]*(2*10**5+1)
dpe = [0]*(2*10**5+1)

dpr[1] = 1
dpr[2] = 1
dpe[1] = 1
dpe[2] = 3

for i in range(3,2*10**5+1):
    dpr[i] = (dpr[i-1]+dpr[i-2])%mod
    dpe[i] = (dpe[i-1]+dpe[i-2])%mod
    
for _ in range(q):
    n = int(input())
    ans = 5*dpr[n]**2%mod-dpe[n]**2%mod
    print(ans%mod)
0