結果
問題 | No.657 テトラナッチ数列 Easy |
ユーザー |
|
提出日時 | 2018-06-15 00:29:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 19 ms / 2,000 ms |
コード長 | 226 bytes |
コンパイル時間 | 691 ms |
コンパイル使用メモリ | 63,440 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 14:38:22 |
合計ジャッジ時間 | 1,636 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; int t[1<<17]; main() { t[4]=1; for(int i=5;i<5000;i++) { t[i]=(t[i-1]+t[i-2]+t[i-3]+t[i-4])%17; } int q;cin>>q; for(;q--;) { int n;cin>>n; cout<<t[(n-1)%4912+1]<<endl; } }