Submission #895201

#TimeUsernameProblemLanguageResultExecution timeMemory
895201IrateHotter Colder (IOI10_hottercolder)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; // int Guess(int n){ // // cout << "? " << n << ": "; // int num; // cin >> num; // return num; // } int HC(int n){ int l = 1, r = n, last = 1; Guess(1); while(l < r){ int mid = (l + r) >> 1; // cout << l << ", " << r << ": " << last << '\n'; if(last == l){ int num = Guess(r); if(num == -1){ r = mid - 1; last = r; Guess(r); } else if(num == 1){ l = mid + 1; last = l; Guess(l); } else{ return (l + r) >> 1; } } else{ int num = Guess(l); if(num == 1){ r = mid - 1; last = r; Guess(r); } else if(num == -1){ l = mid + 1; last = l; Guess(l); } else return (l + r) >> 1; } } return l; } // int main(){ // int n, X; // cin >> n >> X; // cout << HC(n); // }

Compilation message (stderr)

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:11:5: error: 'Guess' was not declared in this scope
   11 |     Guess(1);
      |     ^~~~~