結果

問題 No.657 テトラナッチ数列 Easy
ユーザー mlpj56d
提出日時 2018-03-09 12:00:46
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 415 bytes
コンパイル時間 2,184 ms
コンパイル使用メモリ 63,872 KB
実行使用メモリ 13,764 KB
最終ジャッジ日時 2024-10-08 00:14:08
合計ジャッジ時間 6,353 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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