結果
| 問題 |
No.657 テトラナッチ数列 Easy
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-02-11 23:10:40 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 2,000 ms |
| コード長 | 463 bytes |
| コンパイル時間 | 697 ms |
| コンパイル使用メモリ | 69,888 KB |
| 実行使用メモリ | 7,372 KB |
| 最終ジャッジ日時 | 2024-10-01 09:20:08 |
| 合計ジャッジ時間 | 1,883 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> dta;
for(int i = 0; 3 > i; i++){
dta.push_back(0);
}
dta.push_back(1);
for(int i = 0; 1000000 > i; i++){
int t = 0;
for(int j = 1; 4 >= j; j++){
t = (t+dta[dta.size()-j])%17;
}
dta.push_back(t);
}
int q;cin>>q;
while(q--){
int z;cin>>z;
cout << dta[--z] << endl;
}
}