Time limit: 0.02s
Memory limit: 64MB
Input: test.in
Output: test.out
There's a hidden number x
and you are given the task to find its value using the following function:
int compare (int guess) {
return guess > x;
}
In other words, the functions returns 1
if your guess is bigger than the number you're trying to find, 0
otherwise.
You must only implement the solve
function with the following header:
int solve()
Restrictions
1 ≤ x ≤ 1 000 000 000
- The problem can only be solved using C++ and you must
#include "compare.h"
Example
int solve() {
int x = 2;
if (compare(x))
return 1;
return 1'000'000'000;
}
Explanation
The sample function only gives the right answer if x
is 1
or 1 000 000 000
.