# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
96373 | figter001 | The Big Prize (IOI17_prize) | C++14 | 0 ms | 0 KiB |
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;
typedef long long ll;
const int maxn = 2e5+50;
int ans,n;
void solve(int l,int r){
if(l > r || ans != -1)return;
int md = (l+r)/2;
vector<int> res = ask(a);
if(res[0] > res[1]){
solve(l,md-1);
solve(md+1,r);
}else{
solve(md+1,r);
solve(l,md-1);
}
}
int find_best(int N) {
memset(dp,0,sizeof(dp));
n = N;
ans = -1;
solve(0,n-1);
return ans;
}