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>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
#include "prize.h"
int find_best(int n) {
int low=0;
int high=n-1;
while(low<high-1){
int mid=(low+high)/2;
vector<int> res=ask(mid);
if(res[0]>0){
high=mid;
}
else{
low=mid;
}
}
vector<int> res=ask(high);
if(res[0]==0){
return high;
}
else{
return low;
}
/*for(int i = 0; i < n; i++) {
std::vector<int> res = ask(i);
if(res[0] + res[1] == 0)
return i;
}*/
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |