結果

問題 No.657 テトラナッチ数列 Easy
ユーザー alexara1123alexara1123
提出日時 2019-09-21 13:03:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 274 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 81,696 KB
実行使用メモリ 83,596 KB
最終ジャッジ日時 2023-10-17 23:35:15
合計ジャッジ時間 2,612 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
66,808 KB
testcase_01 AC 53 ms
66,808 KB
testcase_02 AC 53 ms
66,808 KB
testcase_03 AC 53 ms
66,808 KB
testcase_04 AC 53 ms
66,808 KB
testcase_05 AC 140 ms
83,596 KB
testcase_06 AC 52 ms
66,820 KB
testcase_07 AC 53 ms
66,820 KB
testcase_08 AC 53 ms
66,820 KB
testcase_09 AC 108 ms
83,596 KB
testcase_10 AC 108 ms
83,592 KB
testcase_11 AC 107 ms
83,596 KB
testcase_12 AC 109 ms
83,592 KB
testcase_13 AC 109 ms
83,596 KB
testcase_14 AC 109 ms
83,596 KB
testcase_15 AC 109 ms
83,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    q = int(input())
    t = [0] * 1001000
    t[3] = 1
    for i in range(4, 1000500):
        t[i] = (t[i - 1] + t[i - 2] + t[i - 3] + t[i - 4]) % 17
    for i in range(q):
        n = int(input())
        print(t[n-1])


if __name__ == '__main__':
    main()
0