結果

問題 No.657 テトラナッチ数列 Easy
ユーザー YugimnYugimn
提出日時 2022-05-15 23:30:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 636 bytes
コンパイル時間 3,377 ms
コンパイル使用メモリ 188,532 KB
実行使用メモリ 10,812 KB
最終ジャッジ日時 2023-10-11 12:58:19
合計ジャッジ時間 3,906 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
10,548 KB
testcase_01 AC 19 ms
10,528 KB
testcase_02 AC 18 ms
10,524 KB
testcase_03 AC 18 ms
10,596 KB
testcase_04 AC 19 ms
10,536 KB
testcase_05 AC 33 ms
10,784 KB
testcase_06 AC 19 ms
10,596 KB
testcase_07 AC 19 ms
10,812 KB
testcase_08 AC 18 ms
10,528 KB
testcase_09 AC 34 ms
10,548 KB
testcase_10 AC 35 ms
10,544 KB
testcase_11 AC 34 ms
10,776 KB
testcase_12 AC 35 ms
10,544 KB
testcase_13 AC 36 ms
10,548 KB
testcase_14 AC 36 ms
10,644 KB
testcase_15 AC 36 ms
10,716 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:9:12: 警告: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’
    9 | void print(auto a){
      |            ^~~~
main.cpp:13:13: 警告: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’
   13 | void prints(auto a){
      |             ^~~~
main.cpp:21:13: 警告: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’
   21 | void printl(auto a){
      |             ^~~~

ソースコード

diff #

//Normal

#define _GLIBCXX_DEBUG
#define ll long long
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;

void print(auto a){
  cout << a;
}

void prints(auto a){
  cout << a << " ";
}

void prints(){
  cout << " ";
}

void printl(auto a){
  cout << a << endl;
}

void printl(){
  cout << endl;
}

void fix(int n){
  cout << fixed << setprecision(n);
}

int main(){
  vector<int> X(2e6, 0);
  X[4] = 1;

  for(int i = 5; i <= 1e6; i++){
    X[i] = X[i-4]+X[i-3]+X[i-2]+X[i-1];

    X[i] %= 17;
  }

  int Q; cin >> Q;
  for(int i = 0; i < Q; i++){
    int M; cin >> M;

    printl(X[M]);
  }

  return 0;
}
0