結果

問題 No.657 テトラナッチ数列 Easy
ユーザー mlpj56dmlpj56d
提出日時 2018-03-09 23:42:27
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 451 ms
コンパイル使用メモリ 54,400 KB
実行使用メモリ 14,364 KB
最終ジャッジ日時 2024-04-19 03:48:59
合計ジャッジ時間 5,943 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
14,364 KB
testcase_01 AC 4 ms
7,296 KB
testcase_02 AC 4 ms
7,296 KB
testcase_03 AC 5 ms
7,296 KB
testcase_04 WA -
testcase_05 AC 19 ms
7,424 KB
testcase_06 AC 4 ms
7,296 KB
testcase_07 AC 4 ms
7,424 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 t[1010101];
    int q;
    cin >> q;
    for(int i=0; i<q; i++){
        int n;
        cin >> n;
        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