Submission #927201

#TimeUsernameProblemLanguageResultExecution timeMemory
927201vjudge1Hotter Colder (IOI10_hottercolder)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; void Guess(int n) { cout << "Guess(" << n << ")"; int res; cin >> res; return res; } void HC(int n) { int l = 1, r = n, mid; int last = n; Guess(n); while(true) { mid = (l + r) >> 1; int g = Guess(mid); if(g == 1) { r = mid; } else if(g == -1) { l = mid; } else { cout << (last - mid) / 2; return; } last = mid; } }

Compilation message (stderr)

hottercolder.cpp: In function 'void Guess(int)':
hottercolder.cpp:8:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
    8 |     return res;
      |            ^~~
hottercolder.cpp: In function 'void HC(int)':
hottercolder.cpp:17:22: error: void value not ignored as it ought to be
   17 |         int g = Guess(mid);
      |                 ~~~~~^~~~~