# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
722420 | tvladm2009 | The Big Prize (IOI17_prize) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "prize.h"
using namespace std;
typedef long long ll;
int find_best(int N) {
int l = 1, r = N;
while (l < r) {
int mid = (l + r) / 2;
int cnt[2] = ask(mid);
if (cnt[0] == 0 && cnt[1] == 0) {
return mid;
} else if (cnt[0] < cnt[1]) {
l = mid + 1;
} else {
r = mid;
}
}
return l;
}