結果
問題 |
No.954 Result
|
ユーザー |
|
提出日時 | 2020-01-26 11:00:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 630 bytes |
コンパイル時間 | 757 ms |
コンパイル使用メモリ | 65,212 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-14 10:54:14 |
合計ジャッジ時間 | 1,884 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 7 |
other | AC * 27 WA * 2 |
ソースコード
#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; while(a[count]>=n3){ if(a[count]==n3) count++; fibo_advance(n1,n2,n3); //cout<<"a[i]"<<a[count]<<endl; //cout<<n1<<","<<n2<<","<<n3<<endl; } return count; } int main(){ input(); int res=solve(); std::cout<<res<<std::endl; }