結果
| 問題 |
No.954 Result
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-06 03:13:58 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 439 bytes |
| コンパイル時間 | 2,350 ms |
| コンパイル使用メモリ | 191,836 KB |
| 最終ジャッジ日時 | 2025-01-10 07:07:27 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 7 |
| other | AC * 29 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | rep(i,5) scanf("%lld",&a[4-i]);
| ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using lint=long long;
int main(){
lint fib[100]={1,1};
rep(i,90) fib[i+2]=fib[i+1]+fib[i];
lint a[5];
rep(i,5) scanf("%lld",&a[4-i]);
for(int d=5;d>0;d--){
bool found=false;
rep(i,90-d){
bool ok=true;
rep(j,d) if(a[j]!=fib[i+j]) ok=false;
if(ok) found=true;
}
if(found) return printf("%d\n",d),0;
}
puts("0");
return 0;
}