結果
問題 | No.657 テトラナッチ数列 Easy |
ユーザー |
![]() |
提出日時 | 2018-12-28 11:13:32 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 397 ms |
コンパイル使用メモリ | 57,048 KB |
実行使用メモリ | 7,424 KB |
最終ジャッジ日時 | 2024-10-01 14:58:01 |
合計ジャッジ時間 | 1,308 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <iostream> #include <algorithm> #include <cstdio> #include <string> #define ll long long using namespace std; int T[1000001]; int main(){ T[1]=T[2]=T[3]=0; T[4]=1; for(int i=5;i<=1000000;++i) T[i]=(T[i-1]+T[i-2]+T[i-3]+T[i-4])%17; int q; cin>>q; int p; for(int i=0;i<q;++i){ cin>>p; cout<<T[p]<<endl; } return 0; }