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 "prize.h"
#include<bits/stdc++.h>
using namespace std;
int ans = -1;
void solve(int l, int r){
int m = (l + r) / 2;
auto temp = ask(m);
if(!temp[0] && !temp[1]) {
ans = m;
return;
}
if(temp[0] && l != r){
solve(l, m - 1);
}
if(temp[1] && l != r){
solve(m + 1, r);
}
}
int find_best(int N) {
solve(0, N - 1);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |