Submission #232351

# Submission time Handle Problem Language Result Execution time Memory
232351 2020-05-16T19:55:11 Z crossing0ver Hotter Colder (IOI10_hottercolder) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "grader.h"
using namespace std;


int HC(int N){
	if (N == 1) return 1;
	int m = N/2;
	guess(m);
	int ask,last = m;
	int l = 1, r = N;
	int x = (3*N + 3)/4;
	ask = guess(x);
	while (l != r)
	{
		
	if (ask == 0) {
		return (last + x)/2;		
	}
	if (ask == 1) {
		if (last < x)
		l = (last + x + 1)/2;
		else r = (x + last -1)/2;
	}
	else {
		if (last < x) 
		r = (last + x - 1)/2;
		else l = (last + x + 1)/2;
	}
	if (l == r) return l;
	last = x;
	x = (l + r)/2;
	ask = guess(x);    
	}

}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:9:2: error: 'guess' was not declared in this scope
  guess(m);
  ^~~~~
hottercolder.cpp:9:2: note: suggested alternative: 'Guess'
  guess(m);
  ^~~~~
  Guess
hottercolder.cpp:36:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^