結果

問題 No.657 テトラナッチ数列 Easy
ユーザー GrayCoderGrayCoder
提出日時 2018-03-03 07:12:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 207 ms / 2,000 ms
コード長 291 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 10,752 KB
実行使用メモリ 16,640 KB
最終ジャッジ日時 2023-09-05 13:24:17
合計ジャッジ時間 2,310 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,856 KB
testcase_01 AC 16 ms
7,812 KB
testcase_02 AC 16 ms
7,824 KB
testcase_03 AC 17 ms
7,812 KB
testcase_04 AC 170 ms
15,204 KB
testcase_05 AC 37 ms
8,460 KB
testcase_06 AC 15 ms
7,808 KB
testcase_07 AC 16 ms
7,712 KB
testcase_08 AC 183 ms
15,716 KB
testcase_09 AC 39 ms
8,808 KB
testcase_10 AC 41 ms
8,904 KB
testcase_11 AC 40 ms
8,844 KB
testcase_12 AC 56 ms
9,528 KB
testcase_13 AC 207 ms
16,576 KB
testcase_14 AC 207 ms
16,640 KB
testcase_15 AC 207 ms
16,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    Q = int(input())
    N = tuple(int(input()) for _ in [0] * Q)

    lst = [i for i in tetra(max(N))]
    for n in N:
        print(lst[n-1])

def tetra(n):
    a, b, c, d = 0, 0, 0, 1
    for _ in range(n):
        yield a
        a, b, c, d = b, c, d, (a+b+c+d) % 17

main()
0