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>
#include "prize.h"
using namespace std;
int find_best(int n) {
vector<int> ar = ask(0);
if(ar[1] == 0)
return 0;
int pos = 0;
for(int i = 17 ; i >= 0 ; i--)
{
int target = pos + (1<<i);
if(target < n and ask(target)[1] == 1)
pos = target ;
}
return pos + 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |