結果
問題 | No.954 Result |
ユーザー | kotatsugame |
提出日時 | 2019-12-19 00:02:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 395 bytes |
コンパイル時間 | 546 ms |
コンパイル使用メモリ | 64,256 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 12:37:52 |
合計ジャッジ時間 | 1,364 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 7 |
other | AC * 29 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; long A[5]; long F[114514]; main() { F[0]=1; F[1]=1; int id=2; for(;F[id-1]<1e17;id++)F[id]=F[id-1]+F[id-2]; int ans=0; for(int i=0;i<5;i++)cin>>A[i]; for(int i=4;i<5;i++) { for(int j=0;j<id;j++) { for(int k=0;k<=i;k++) { if(j+k<id&&A[i-k]==F[j+k]) { if(ans<k+1)ans=k+1; } else break; } } } cout<<ans<<endl; }