結果

問題 No.657 テトラナッチ数列 Easy
ユーザー ahe100ahe100
提出日時 2018-06-06 21:51:20
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 744 bytes
コンパイル時間 542 ms
コンパイル使用メモリ 71,724 KB
実行使用メモリ 11,452 KB
最終ジャッジ日時 2023-09-12 22:52:42
合計ジャッジ時間 2,039 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
11,164 KB
testcase_01 AC 22 ms
11,452 KB
testcase_02 AC 22 ms
11,212 KB
testcase_03 AC 22 ms
11,164 KB
testcase_04 AC 23 ms
11,200 KB
testcase_05 WA -
testcase_06 AC 22 ms
11,156 KB
testcase_07 AC 22 ms
11,148 KB
testcase_08 AC 23 ms
11,156 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;
ll mod = 17;
ll inf = 1e18;

//WA

int main(void){
	ll Q,n[1010],t[1000010];
	t[1]=0;
	t[2]=0;
	t[3]=0;
	t[4]=1;
	reg(i,5,1000000)t[i]=(t[i-1]+t[i-2]+t[i-3]+t[i-4])%mod;
	cin>>Q;
	rep(i,Q)cin>>n[i];
	rep(i,Q)cout<<t[n[i]]<<endl;;
}
0