#include "grader.h"
#include <iostream>
int HC(int N)
{
int l = 0, r = N + 1;
while (l < r - 2)
{
int mid = (l + r) / 2;
Guess(l + 1);
int res = Guess(r - 1);
if (res == 0)
{
return mid;
}
if (r - l == 2)
{
return l + 1;
}
if (res == -1)
{
r = mid + ((l + r) % 2 == 1);
} else
{
l = mid;
}
}
return l + 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
6744 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
6748 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
6744 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
474 ms |
8276 KB |
Output is partially correct - alpha = 0.068965517241 |