답안 #226766

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
226766 2020-04-25T09:33:15 Z jiahng Hotter Colder (IOI10_hottercolder) C++14
컴파일 오류
0 ms 0 KB
//#include "grader.h"
#include <bits/stdc++.h>
typedef long long ll;
int HC(int N){
	ll l = 1, r = N + 1;
	
	
	

	while (l + 3 < r){
		int mid = (l+r)/2;
		
		//std::cout<<l<<' '<<r<<'\n';
		
		int mid2 = (l+mid)/2;
		Guess((l+r)/2);
		//std::cout<<mid2<<' ';
		int res = Guess(mid2);
		//std::cout<<res<<'\n';
		
		if (res == 1) r = mid;
		else if (res == -1) l = mid2;
		else return (mid+mid2)/2;
	}
	
	//std::cout<<l<<' ';
	int cur = l;
	Guess(l);
	
	if (l+1 <= N && Guess(l+1) == 1) cur = l+1;
	Guess(cur);
	
	if (l+2 <= N && Guess(l+2) == 1) cur = l+2;
	Guess(cur);
	
	if (l+3 <= N && Guess(l+3) == 1) cur = l+3;
	
	//std::cout<<l<<'\n';
	return cur;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:16:3: error: 'Guess' was not declared in this scope
   Guess((l+r)/2);
   ^~~~~
hottercolder.cpp:28:2: error: 'Guess' was not declared in this scope
  Guess(l);
  ^~~~~