結果

問題 No.657 テトラナッチ数列 Easy
ユーザー mlpj56dmlpj56d
提出日時 2018-03-09 12:00:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 415 bytes
コンパイル時間 658 ms
コンパイル使用メモリ 64,128 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-04-16 20:50:20
合計ジャッジ時間 6,050 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,624 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 16 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<iostream>
using namespace std;
int main (){
    int q;
    cin >> q;
    for(int i=0; i<q; i++){
        int n;
        cin >> n;
        int t[n] ={0};
        for(int j=0; j<n; j++){
            if( j < 3 ) t[j] = 0;
            else if ( j == 3 ) t[j] = 1;
            else t[j] = t[j-1] + t[j-2] + t[j-3] + t[j-4];
        }
        cout << t[n-1] % 17 << endl;
    }
    return 0;
}
0