제출 #117260

#제출 시각아이디문제언어결과실행 시간메모리
117260WongHokFong_cpp커다란 상품 (IOI17_prize)C++14
컴파일 에러
0 ms0 KiB
#include <iostream>
int res[2];
int find_best(int n)
{
	int l=0,r=n-1;
	do
	{
		int mid=(l+r)/2;
		res=ask(mid);
		if (res[1]>0) r=mid;
		else if (res[2]>0) l=mid;
		else return mid; 
	}
	while (l<r);
}

컴파일 시 표준 에러 (stderr) 메시지

prize.cpp: In function 'int find_best(int)':
prize.cpp:9:7: error: 'ask' was not declared in this scope
   res=ask(mid);
       ^~~
prize.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^