#include "grader.h"
#include <cassert>
int HC(int N)
{
int n = N;
int l = 1, r = n;
while (l <= r)
{
if (l == r)
return l;
int m = (l + r) / 2;
Guess(l);
int u = Guess(r);
if (u == 0)
{
return m;
}
if ((r - l + 1) % 2 == 1)
{
if (u == 1)
l = m + 1;
else
r = m - 1;
}
else
{
if (u == 1)
l = m + 1;
else
r = m;
}
}
assert(false);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
1408 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
25 ms |
1280 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
1280 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
841 ms |
8168 KB |
Output is partially correct - alpha = 0.068965517241 |