結果

問題 No.954 Result
ユーザー vectorccvectorcc
提出日時 2020-01-26 11:04:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 609 bytes
コンパイル時間 440 ms
コンパイル使用メモリ 63,420 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-12 12:00:41
合計ジャッジ時間 1,684 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,352 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 1 ms
4,352 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 1 ms
4,352 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 2 ms
4,352 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 1 ms
4,352 KB
testcase_14 AC 2 ms
4,352 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 1 ms
4,352 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 2 ms
4,352 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 2 ms
4,352 KB
testcase_22 AC 1 ms
4,352 KB
testcase_23 AC 1 ms
4,348 KB
testcase_24 AC 1 ms
4,352 KB
testcase_25 AC 2 ms
4,352 KB
testcase_26 AC 1 ms
4,352 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 2 ms
4,348 KB
testcase_30 WA -
testcase_31 AC 1 ms
4,348 KB
testcase_32 AC 2 ms
4,348 KB
testcase_33 AC 1 ms
4,348 KB
testcase_34 AC 1 ms
4,348 KB
testcase_35 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0