結果
| 問題 |
No.657 テトラナッチ数列 Easy
|
| コンテスト | |
| ユーザー |
aka_rice
|
| 提出日時 | 2018-03-03 11:04:47 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 836 bytes |
| コンパイル時間 | 1,814 ms |
| コンパイル使用メモリ | 168,260 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-23 19:42:15 |
| 合計ジャッジ時間 | 4,485 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 13 |
ソースコード
#include <bits/stdc++.h>
#define pout(n) printf ("%d\n", n)
#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)
#define BIT(bit,a,n) for (int bit = a;bit < (1<<n);bit++) // {0, 1, ..., n-1} の部分集合の全探索 // n番目のフラグが立っている状態は (1<<n)
const int d4x[4] = {1, 0, -1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 };
#define MAX_N (int)2e5+20
typedef long long ll;
using namespace std;
int q;
int main(){
scanf("%d",&q);
vector<int> t(q);
t[0] = 0;
t[1] = 0;
t[2] = 0;
t[3] = 1;
rep(i,4,1000000){
t[i] = (t[i-1]+t[i-2]+t[i-3]+t[i-4])%17;
}
int a[q];
rep(i,0,q){
cin >> a[i];
printf("%d\n",t[a[i]-1]);
}
}
aka_rice