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>
#define ll long long
#define pb push_back
#define ff first
#define ss second
using namespace std;
int find_best(int n) {
int li = 0, ls = n-1, pos;
pos = (li + ls)/2;
while(li + 1 < ls){
vector<int>ans = ask(pos);
if(ans[0] > ans[1]){
ls = pos-1;
}else if(ans[1] > ans[0]){
li = pos+1;
}else{
return pos;
}
pos = (li + ls)/2;
}
vector<int>ans = ask(pos);
if(ans[0] + ans[1] == 0)return pos;
else return pos + 1;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |