結果

問題 No.657 テトラナッチ数列 Easy
ユーザー GrayCoder
提出日時 2018-03-02 23:41:10
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 419 bytes
コンパイル時間 566 ms
コンパイル使用メモリ 82,280 KB
実行使用メモリ 60,516 KB
最終ジャッジ日時 2024-06-22 13:47:45
合計ジャッジ時間 3,966 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other AC * 4 TLE * 1 -- * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    for n in N:
        i = tetra(n)
        print(i % 17)

def tetra(n):
    def tetra2(g, m):
        for i in range(m):
            yield next(g)
    for num in tetra2(tetra_seq(), n):
        fn = num
    return fn

def tetra_seq():
    a, b, c, d = 0, 0, 0, 1
    while 1:
        yield a
        a, b, c, d = b, c, d, a+b+c+d

main()
0