Submission #754533

# Submission time Handle Problem Language Result Execution time Memory
754533 2023-06-07T23:17:55 Z ValiAntonie Hotter Colder (IOI10_hottercolder) C++14
Compilation error
0 ms 0 KB
#include "grader.h"
#include<bits/stdc++.h>
using namespace std;
 
int Guess (int x);
 
int HC(int N){
int st=1,dr=N;
Guess(st);
int a = Guess(dr);
int prev = -1;
while(st!=dr){
	int mij = (st+ dr) >> 1;
	if(a==-1){
		dr= mij;
    if(st != dr){
	Guess(st);
	a = Guess(dr);
	prev = 0;
	}
	}
	else if(a==1){//close to l
		st = mij + 1;
    if(st != dr){
            if(prev == 0){
            x = Guess(st);
            x = -x;
            prev = 1;
            }
            else{
            Guess(st);
            x = Guess(dr);
            prev = 0;
            }
	}
	}
	else return mij;
}
return st;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:26:13: error: 'x' was not declared in this scope
   26 |             x = Guess(st);
      |             ^
hottercolder.cpp:32:13: error: 'x' was not declared in this scope
   32 |             x = Guess(dr);
      |             ^