結果
問題 | No.657 テトラナッチ数列 Easy |
ユーザー |
![]() |
提出日時 | 2018-03-09 23:44:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 457 bytes |
コンパイル時間 | 391 ms |
コンパイル使用メモリ | 54,644 KB |
実行使用メモリ | 14,244 KB |
最終ジャッジ日時 | 2024-10-10 20:28:46 |
合計ジャッジ時間 | 7,622 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 TLE * 2 -- * 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; t[0]=0; t[1]=0; t[2]=0; t[3]=1; for(int j=4; j<n; j++){ t[j] = (t[j-1] + t[j-2] + t[j-3] + t[j-4]) % 17; // int超えある } cout << t[n-1] << endl; } return 0; }