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 find_best(int n) {
int st = 0, en = n - 1;
cout << st << " " << en << '\n';
while(en - st > 1)
{
int mid = (st + en) / 2;
auto a = ask(mid);
if(a[0] >= a[1])
en = mid;
else
st = mid + 1;
// cout << a[0] << " " << a[1] << " " << st << " " << en << '\n';
}
auto a = ask(st);
if(a[0] + a[1] == 0)
return st;
return en;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |