結果

問題 No.657 テトラナッチ数列 Easy
ユーザー bennkei0327bennkei0327
提出日時 2018-03-19 07:10:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 353 bytes
コンパイル時間 468 ms
コンパイル使用メモリ 64,148 KB
実行使用メモリ 7,552 KB
最終ジャッジ日時 2023-08-30 03:31:47
合計ジャッジ時間 1,534 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
7,520 KB
testcase_01 AC 5 ms
7,408 KB
testcase_02 AC 4 ms
7,456 KB
testcase_03 AC 4 ms
7,412 KB
testcase_04 WA -
testcase_05 AC 6 ms
7,424 KB
testcase_06 AC 4 ms
7,492 KB
testcase_07 AC 5 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 main(){
  int Q;
  int i,t;
  scanf("%d", &Q);
  int box[Q];
  int T[1000001] = {0,0,0,0,1};

  for(i = 5; i <= 1000000; i++){
    T[i] = T[i-1]+T[i-2]+T[i-3]+T[i-4];
  }

  for(i = 0; i < Q; i++){
    scanf("%d",&t);
    box[i] = t;
  }


  for(i = 0; i < Q; i++){
    printf("%d\n", T[box[i]]%17);
  }

}
0