結果
問題 |
No.658 テトラナッチ数列 Hard
|
ユーザー |
![]() |
提出日時 | 2018-03-02 23:31:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 415 bytes |
コンパイル時間 | 579 ms |
コンパイル使用メモリ | 67,148 KB |
実行使用メモリ | 814,168 KB |
最終ジャッジ日時 | 2024-06-22 11:52:45 |
合計ジャッジ時間 | 3,433 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 MLE * 1 |
other | -- * 8 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <math.h> using namespace std; int main() { int q; vector<int> t = {0,0,0,1}; int n; cin >> q; for(int i = 0;i < q;i++){ cin >> n; for(int j = t.size();j <= n;j++){ t.push_back((t[j-1]+t[j-2]+t[j-3]+t[j-4])%17); } cout << t[n-1] % 17 << endl; } return 0; }