This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |