Submission #1077080

# Submission time Handle Problem Language Result Execution time Memory
1077080 2024-08-26T22:27:39 Z boyliguanhan Hotter Colder (IOI10_hottercolder) C++17
Compilation error
0 ms 0 KB
int Guess(int N);
int HC(int N){
  int l=1,r=n;
  while(l<r){
    int mid=l+r>>1;
    Guess(mid);
    int x=Guess(mid+1);
    if(x<0)
      r=mid;
    else l=mid+1;
  }
  return  l;
}

Compilation message

hottercolder.cpp: In function 'int HC(int)':
hottercolder.cpp:3:13: error: 'n' was not declared in this scope
    3 |   int l=1,r=n;
      |             ^
hottercolder.cpp:5:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    5 |     int mid=l+r>>1;
      |             ~^~