結果
問題 | No.657 テトラナッチ数列 Easy |
ユーザー |
![]() |
提出日時 | 2018-03-09 23:42:27 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 412 bytes |
コンパイル時間 | 391 ms |
コンパイル使用メモリ | 54,388 KB |
実行使用メモリ | 12,672 KB |
最終ジャッジ日時 | 2024-10-10 20:26:15 |
合計ジャッジ時間 | 5,984 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 5 WA * 5 TLE * 1 -- * 2 |
ソースコード
#include<stdio.h> #include<iostream> using namespace std; int main (){ int t[1010101]; int q; cin >> q; for(int i=0; i<q; i++){ int n; cin >> n; for(int j=0; j<n; j++){ if( j < 3 ) t[j] = 0; else if ( j == 3 ) t[j] = 1; else t[j] = t[j-1] + t[j-2] + t[j-3] + t[j-4]; } cout << t[n-1] % 17 << endl; } return 0; }