結果

問題 No.657 テトラナッチ数列 Easy
ユーザー 0918nobita0918nobita
提出日時 2018-03-19 10:34:17
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 343 bytes
コンパイル時間 404 ms
コンパイル使用メモリ 51,600 KB
実行使用メモリ 7,552 KB
最終ジャッジ日時 2023-08-30 03:34:02
合計ジャッジ時間 1,489 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
7,312 KB
testcase_01 AC 7 ms
7,260 KB
testcase_02 AC 7 ms
7,324 KB
testcase_03 AC 8 ms
7,260 KB
testcase_04 WA -
testcase_05 AC 21 ms
7,284 KB
testcase_06 AC 7 ms
7,268 KB
testcase_07 AC 7 ms
7,388 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int T[1000001] = {0, 0, 0, 1};

int main() {
    int Q, n;
    
    for (int i = 4; i <= 1000000; i++)
        T[i] = T[i - 1] + T[i - 2] + T[i - 3] + T[i - 4];
    
    cin >> Q;
    
    for (int i = 0; i < Q; i++) {
        cin >> n;
        cout << T[n - 1] % 17 << endl;
    }
    
    return 0;
}
0