#include "grader.h"
int HC(int N){
int l = 1, r = N, las;
int mid = (N + 1) / 2;
if (N == 1){
return 1;
}
else if (N == 2){
Guess(1);
int g = Guess(2);
if (g > 0){
return 2;
}
return 1;
}
int g = Guess(mid - 1);
las = mid - 1;
while (l != r){
mid = (l + r) / 2;
if (mid == las){
mid += 1;
}
g = Guess(mid);
if (g > 0){
if (las < mid){
if (l == mid){
l = mid + 1;
}
else{
l = mid;
}
}
else{
r = mid;
}
}
else if (g < 0){
if (las < mid){
r = mid;
}
else{
if (l == mid){
l = mid + 1;
}
else{
l = mid;
}
}
}
else{
return (mid + las) / 2;
}
las = mid;
}
return l;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
25 ms |
13136 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
25 ms |
13232 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
26 ms |
13200 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
472 ms |
149952 KB |
Output isn't correct - alpha = 0.000000000000 |