Time limit: 0.02s
Memory limit: 64MB
Input: test.in
Output: test.out
Task
There's a hidden number 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 function returns if your guess is bigger than the number you're trying to find, otherwise.
You must only implement the solve
function with the following header:
int solve()
Constraints and clarifications
- The problem can only be solved using C++ and you must
#include "compare.h"
.
Example
#include "compare.h"
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 is or .