結果
問題 |
No.954 Result
|
ユーザー |
|
提出日時 | 2020-01-26 11:04:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 609 bytes |
コンパイル時間 | 761 ms |
コンパイル使用メモリ | 63,488 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 10:54:16 |
合計ジャッジ時間 | 1,559 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 WA * 1 |
other | AC * 25 WA * 4 |
ソースコード
#include<iostream> #include<array> #define REP(i,N) for(int i=0,__i=N;i<__i;++i) long long __next; #define fibo_advance(a,b,c) \ __next=b+c;\ a=b;\ b=c;\ c=__next std::array<long long,5> a; bool input(){ REP(i,5) std::cin>>a[5-1-i]; return true; } int solve(){ using namespace std; long long n1=0,n2=0,n3=1; long long count=0,tmp; bool f_find=false; while(a[count]>n3){ fibo_advance(n1,n2,n3); } while(a[count]==n3){ count++; fibo_advance(n1,n2,n3); } return count; } int main(){ input(); int res=solve(); std::cout<<res<<std::endl; }