#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int ans,n;
void solve(int l,int r){
if(l > r || ans != -1)return;
int md = (l+r)/2;
vector<int> res = ask(md);
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) {
n = N;
ans = -1;
solve(0,n-1);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
37 ms |
376 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
42 ms |
308 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |