結果

問題 No.657 テトラナッチ数列 Easy
ユーザー StarMatyanStarMatyan
提出日時 2018-07-25 20:35:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 478 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 10,572 KB
実行使用メモリ 12,640 KB
最終ジャッジ日時 2023-09-09 08:12:31
合計ジャッジ時間 6,812 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,812 KB
testcase_01 AC 15 ms
7,820 KB
testcase_02 AC 16 ms
7,908 KB
testcase_03 AC 15 ms
7,884 KB
testcase_04 AC 336 ms
7,852 KB
testcase_05 AC 60 ms
7,808 KB
testcase_06 AC 15 ms
7,844 KB
testcase_07 AC 14 ms
7,812 KB
testcase_08 AC 437 ms
7,844 KB
testcase_09 TLE -
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

firstdata = int(input());
result = 0;
siteik = 0;

for inp in range(0,firstdata):
    first = 0;
    second = 0;
    third = 0;
    four = 1;
    siteik = int(input());
    if siteik < 4:
        print(0);
    elif siteik == 4:
        print(1);
    else:
        for inp2 in range(5,siteik+1):
            result = (first+second+third+four)%17;
            first = second;
            second = third;
            third = four;
            four = result;
        print(result);
0