#include "prize.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 2e5+50;
int l,r,dp[maxn],ans;
void qu(int a){
if(dp[a])return;
dp[a] = 1;
vector<int> res = ask(a);
if(res[0] == 0 && res[1] == 0){
ans = a;
}
}
int find_best(int n) {
srand(time(0));
l=0;r=n-1;
ans = -1;
while(1){
int a = l + (rand() % (r-l+1));
qu(a);
if(ans != -1)return ans;
}
while(1)ans++;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
39 ms |
1180 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
28 ms |
1052 KB |
Output is correct |
2 |
Incorrect |
58 ms |
1244 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |