bs_interactive

Time limit: 0.02s Memory limit: 64MB Input: test.in Output: test.out

Task

There's a hidden number xx 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 11 if your guess is bigger than the number you're trying to find, 00 otherwise.

You must only implement the solve function with the following header:

int solve()

Constraints and clarifications

  • 1x1 000 000 0001 \leq x \leq 1 \ 000 \ 000 \ 000
  • 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 xx is 11 or 1 000 000 0001 \ 000 \ 000 \ 000.

Log in or sign up to be able to send submissions!