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 bbi(int ini, int fim) {
if(ini==fim) return ini-1;
int mid=ini+fim; mid/=2;
vector<int> aux=ask(mid-1);
// printf("%d %d :: %d >> %d %d\n", ini, fim, mid, aux[0], aux[1]);
if(aux[0]==aux[1]&&aux[0]==0) return mid-1;
if(aux[0]) return bbi(ini, mid-1);
else return bbi(mid+1, fim);
}
int find_best(int n) {
// printf("asd %d\n", bbi(1, n));
return bbi(1, n);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |