結果
| 問題 | No.657 テトラナッチ数列 Easy |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-06 19:27:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 545 bytes |
| コンパイル時間 | 587 ms |
| コンパイル使用メモリ | 61,068 KB |
| 実行使用メモリ | 9,296 KB |
| 最終ジャッジ日時 | 2024-09-21 15:10:49 |
| 合計ジャッジ時間 | 1,738 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 5 WA * 8 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main() {
int q;
cin >> q;
int n;
vector<int> tetoranatch;
for(int i = 0; i < 4; i++) {
tetoranatch.push_back(0);
}
tetoranatch.push_back(1);
for(int i = 0; i < q; i++) {
cin >> n;
if(tetoranatch.size() - 1 < n) {
while(tetoranatch.size() - 1 < n) {
int tmp = 0;
for(int j = 1; j <= 4; j++) {
tmp += tetoranatch.at(tetoranatch.size() - j);
}
tetoranatch.push_back(tmp);
}
}
cout << tetoranatch.at(n) % 17 << endl;
}
return 0;
}