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"
//#include "grader.cpp"
using namespace std;
typedef long long ll;
typedef vector<ll>vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef vector<pl> vpl;
typedef vector<int> vi;
#define all(x) x.begin(),x.end()
#define print(x) {for(auto it:x) cout << it << " " ;cout << "\n";}
#define out(x) {cout << x << "\n"; return;}
#define GLHF ios_base::sync_with_stdio(false); cin.tie(NULL)
int find_best(int n){
int l=0,r=n-1,ans=-1;
while(l<=r){
int m=(l+r)/2;
vi res=ask(m);
if(!res[0] && !res[1])return m;
if(res[0]){
ans=m;
r=m-1;
}
else
l=m+1;
}
return ans;
}
/*
8
2 2 2 1 2 2 2 2
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |