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 "public_a/cpp/prize.h"
#include "prize.h"
#include <bits/stdc++.h>
int find_best(int n) {
if (!ask(0)[1]) {
return 0;
}
int ans = 0;
int l = 1, r = n - 1;
while (l <= r) {
int mid = (l + r) >> 1;
if (!ask(mid)[0]) {
ans = mid;
l = mid + 1;
} else {
r = mid - 1;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |