#include "prize.h"
#include<bits/stdc++.h>
int find_best(int n) {
int l=0,r=n,h,ans;
while(1)
{
h=(l+r)/2;
std::vector<int> res=ask(h);
if(res[0]+res[1]==0){ans=h;break;}
if(res[0]==1){r=h;}
else l=h;
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
248 KB |
Output is correct |
2 |
Correct |
2 ms |
248 KB |
Output is correct |
3 |
Correct |
2 ms |
248 KB |
Output is correct |
4 |
Correct |
2 ms |
248 KB |
Output is correct |
5 |
Correct |
2 ms |
376 KB |
Output is correct |
6 |
Correct |
2 ms |
376 KB |
Output is correct |
7 |
Correct |
2 ms |
128 KB |
Output is correct |
8 |
Correct |
2 ms |
304 KB |
Output is correct |
9 |
Correct |
2 ms |
396 KB |
Output is correct |
10 |
Correct |
3 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
248 KB |
Output is correct |
3 |
Correct |
3 ms |
424 KB |
Output is correct |
4 |
Correct |
2 ms |
248 KB |
Output is correct |
5 |
Correct |
2 ms |
376 KB |
Output is correct |
6 |
Correct |
2 ms |
376 KB |
Output is correct |
7 |
Correct |
2 ms |
308 KB |
Output is correct |
8 |
Correct |
2 ms |
392 KB |
Output is correct |
9 |
Correct |
2 ms |
248 KB |
Output is correct |
10 |
Correct |
2 ms |
248 KB |
Output is correct |
11 |
Incorrect |
91 ms |
376 KB |
Incorrect |
12 |
Halted |
0 ms |
0 KB |
- |