#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> ans[200500];
int mx = -1;
int find(int l, int r){
if(ans[l][0] == ans[r][0]){
return 0;
}
int m = (l + r) >> 1, L = m, R = m + 1;
while(l < L){
ans[L] =ask(L);
if(ans[L][0] + ans[L][1] == mx){
break;
}
if(ans[L][0] + ans[L][1] == 0){
return L;
}
L--;
}
while(r > R){
ans[R] =ask(R);
if(ans[R][0] + ans[R][1] == mx){
break;
}
if(ans[R][0] + ans[R][1] == 0){
return R;
}
R++;
}
return max(find(l, L), find(r, R));
}
int find_best(int n) {
return 3;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
4900 KB |
answer is not correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
5072 KB |
answer is not correct |
2 |
Halted |
0 ms |
0 KB |
- |