#include <bits/stdc++.h>
using namespace std;
int Guess(int);
int HC(int n) {
int last = n;
int l = 1, r = n, mid;
while(true) {
mid = (l + r) >> 1;
int res = Guess(mid);
if(res == -1) {
if(last > mid) l = mid;
else r = mid;
}
else if(res == 1) {
if(last > mid) r = mid;
else l = mid;
}
else {
return abs(last - mid) / 2;
}
last = mid;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
23 ms |
23120 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
22 ms |
23120 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
22 ms |
23128 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
320 ms |
140884 KB |
Output isn't correct - alpha = 0.000000000000 |
2 |
Halted |
0 ms |
0 KB |
- |