#include "grader.h"
#include <bits/stdc++.h>
using namespace std;
int st, en;
int ask(int l, int r)
{
return Guess((l + r) / 2);
}
int HC(int n)
{
st = 1, en = n + 1;
ask(st, n);
while (st + 1 < en)
{
int mid = (st + en) / 2;
if (ask(st, mid) == 1)
en = mid;
else
{
if (ask(mid, en) != -1)
st = mid;
else
{
ask(st, en);
en = mid;
}
}
}
return st;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
17 ms |
6744 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
18 ms |
6744 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
18 ms |
7000 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
405 ms |
24396 KB |
Output isn't correct - alpha = 0.000000000000 |
2 |
Halted |
0 ms |
0 KB |
- |