結果
| 問題 | No.657 テトラナッチ数列 Easy |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-06-07 14:00:39 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 458 bytes |
| 記録 | |
| コンパイル時間 | 1,179 ms |
| コンパイル使用メモリ | 179,408 KB |
| 実行使用メモリ | 39,712 KB |
| 最終ジャッジ日時 | 2026-03-20 08:37:10 |
| 合計ジャッジ時間 | 28,855 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 |
| other | AC * 5 TLE * 8 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
int f(int n) {
if (n <=3)
return 0;
else if (n == 4)
return 1;
else
return (f(n-1)%17 + f(n-2)%17 + f(n-3)%17 + f(n-4)%17)%17;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int q;
cin >> q;
while (q--) {
int t;
cin >> t;
cout << f(t) << endl;
}
return 0;
}