結果
問題 |
No.657 テトラナッチ数列 Easy
|
ユーザー |
![]() |
提出日時 | 2018-03-05 15:43:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 476 bytes |
コンパイル時間 | 728 ms |
コンパイル使用メモリ | 73,536 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-21 16:38:24 |
合計ジャッジ時間 | 1,849 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 3 WA * 10 |
ソースコード
#include<iostream> #include<vector> #include<bitset> #include<algorithm> #include<cmath> #include<string> using namespace std; #define ll long long ll memo[100000]={}; ll tetora(ll n){ if(n<4) return 0; else if(n==4) return 1; if(memo[n]) memo[n] = tetora(n-1)+tetora(n-2)+tetora(n-3)+tetora(n-4); return memo[n] % 17; } int main(){ ll Q,num; cin >> Q; while(Q--){ cin >> num; cout << tetora(Q) << endl; } return 0; }