結果

問題 No.657 テトラナッチ数列 Easy
ユーザー mlpj56d
提出日時 2018-03-09 11:59:26
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 415 bytes
コンパイル時間 566 ms
コンパイル使用メモリ 54,740 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-10-08 00:02:24
合計ジャッジ時間 6,028 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 5 WA * 5 TLE * 1 -- * 2
権限があれば一括ダウンロードができます

ソースコード

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