結果

問題 No.657 テトラナッチ数列 Easy
ユーザー mlpj56dmlpj56d
提出日時 2018-03-09 12:15:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 385 bytes
コンパイル時間 589 ms
コンパイル使用メモリ 64,512 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-16 21:10:57
合計ジャッジ時間 7,018 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
12,416 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 AC 8 ms
7,108 KB
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 AC 9 ms
7,348 KB
testcase_09 AC 40 ms
5,376 KB
testcase_10 AC 245 ms
5,376 KB
testcase_11 AC 246 ms
5,376 KB
testcase_12 TLE -
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];
        t[0]=0;
        t[1]=0;
        t[2]=0;
        t[3]=1;
    for(int j=4; j<n; j++){
        t[j] = (t[j-1] + t[j-2] + t[j-3] + t[j-4]) % 17;
        }
    cout << t[n-1] << endl;
    }
    return 0;
}
0