結果
| 問題 |
No.658 テトラナッチ数列 Hard
|
| コンテスト | |
| ユーザー |
lunnear
|
| 提出日時 | 2018-12-12 14:43:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 859 bytes |
| コンパイル時間 | 605 ms |
| コンパイル使用メモリ | 61,672 KB |
| 実行使用メモリ | 814,392 KB |
| 最終ジャッジ日時 | 2024-09-25 03:34:11 |
| 合計ジャッジ時間 | 2,698 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 MLE * 1 |
| other | -- * 8 |
ソースコード
#include <iostream>
#include <vector>
int main()
{
std::cin.tie(0);
std::ios::sync_with_stdio(false);
int q;
std::cin >> q;
std::vector<int> list;
int t1 = 0, t2 = 0, t3 = 0, t4 = 1;
list.push_back(0);
list.push_back(0);
list.push_back(0);
list.push_back(1);
for(int i = 0; i < q; i++)
{
long long n;
std::cin >> n;
if(n > list.size())
{
for(long long j = list.size(); j < n; j++)
{
int t = t1 + t2 + t3 + t4;
t %= 17;
list.push_back(t);
t1 = t2;
t2 = t3;
t3 = t4;
t4 = t;
}
}
std::cout << list[n - 1] << "\n";
}
return 0;
}
lunnear