이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "grader.h"
#include <iostream>
using namespace std;
int HC(int n)
{
Guess(1);
int l = 1, r = n;
int last = 1;
while (l < r)
{
int ot = l;
if (2*last < (l + r)) ot = r;
int m = (last + ot);
int rs = Guess(ot);
// cerr << l << " " << r << " " << ot << " " << m << " " << last << "\n";
if (rs == 0) return m/2;
if ((rs == -1) ^ (ot > last))
{
l = m/2 + 1;
}
else
{
r = m/2 - 1 + (m % 2);
}
last = ot;
}
return l;
}
# | 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... |