제출 #895201

#제출 시각아이디문제언어결과실행 시간메모리
895201IrateHotter Colder (IOI10_hottercolder)C++14
컴파일 에러
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); // }

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

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