結果

問題 No.657 テトラナッチ数列 Easy
ユーザー beetbeet
提出日時 2018-03-02 22:22:38
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 2,363 ms
コンパイル使用メモリ 146,780 KB
実行使用メモリ 21,252 KB
最終ジャッジ日時 2023-09-03 22:25:17
合計ジャッジ時間 3,689 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
19,324 KB
testcase_01 AC 17 ms
19,412 KB
testcase_02 AC 16 ms
19,232 KB
testcase_03 AC 17 ms
20,452 KB
testcase_04 AC 18 ms
21,072 KB
testcase_05 AC 31 ms
20,188 KB
testcase_06 AC 17 ms
20,548 KB
testcase_07 AC 16 ms
19,184 KB
testcase_08 AC 17 ms
19,572 KB
testcase_09 AC 33 ms
20,548 KB
testcase_10 AC 33 ms
19,756 KB
testcase_11 AC 33 ms
19,616 KB
testcase_12 AC 35 ms
21,252 KB
testcase_13 AC 34 ms
20,244 KB
testcase_14 AC 34 ms
20,272 KB
testcase_15 AC 34 ms
19,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  vector<Int> t({0,0,0,1});
  for(Int i=0;i<1.1e6;i++)
    t.emplace_back((t[i]+t[i+1]+t[i+2]+t[i+3])%17);
  Int q;
  cin>>q;
  for(Int i=0;i<q;i++){
    Int n;
    cin>>n;
    cout<<t[n-1]<<endl;
  }
  return 0;
}
0