結果

問題 No.2600 Avator Height
ユーザー 👑 amentorimaruamentorimaru
提出日時 2023-12-05 01:56:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 179 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 84,056 KB
最終ジャッジ日時 2023-12-05 02:40:38
合計ジャッジ時間 8,608 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
67,056 KB
testcase_01 AC 171 ms
83,800 KB
testcase_02 AC 171 ms
83,800 KB
testcase_03 AC 179 ms
83,800 KB
testcase_04 AC 172 ms
83,800 KB
testcase_05 AC 173 ms
83,800 KB
testcase_06 AC 173 ms
83,672 KB
testcase_07 AC 173 ms
83,800 KB
testcase_08 AC 170 ms
83,800 KB
testcase_09 AC 166 ms
83,800 KB
testcase_10 AC 162 ms
83,800 KB
testcase_11 AC 162 ms
83,800 KB
testcase_12 AC 162 ms
83,800 KB
testcase_13 AC 160 ms
83,800 KB
testcase_14 AC 162 ms
83,800 KB
testcase_15 AC 161 ms
83,800 KB
testcase_16 AC 160 ms
83,800 KB
testcase_17 AC 160 ms
83,800 KB
testcase_18 AC 159 ms
83,800 KB
testcase_19 AC 161 ms
83,800 KB
testcase_20 AC 159 ms
83,800 KB
testcase_21 AC 157 ms
83,800 KB
testcase_22 AC 160 ms
83,800 KB
testcase_23 AC 162 ms
83,800 KB
testcase_24 AC 168 ms
83,800 KB
testcase_25 AC 167 ms
83,800 KB
testcase_26 AC 168 ms
83,800 KB
testcase_27 AC 167 ms
83,800 KB
testcase_28 AC 165 ms
83,800 KB
testcase_29 AC 161 ms
83,800 KB
testcase_30 AC 177 ms
83,800 KB
testcase_31 AC 131 ms
84,056 KB
testcase_32 AC 139 ms
83,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
def read_values(): return tuple(map(int, input().split()))

def main():  
    q=int(input())
    mod=998244353
    r=[0]*500000
    e=[0]*500000
    r[0]=e[0]=r[1]=1
    e[1]=3
    for i in range(500000-2):
        r[i+2]=(r[i+1]+r[i])%mod
        e[i+2]=(e[i+1]+e[i])%mod
    for _ in range(q):
        n=int(input())
        n-=1
        print((r[n]*r[n]*5-e[n]*e[n])%mod)    
    
if __name__ == "__main__":
    main()
0