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 <bits/stdc++.h>
#include "grader.h"
using namespace std;
int HC(int N){
int l = 1, r = N, mid;
int ask = max(N / 2 - 1, 1);
Guess(ask);
while(l < r){
int nask = min(max(l + r - ask, 1), N);
mid = (ask + nask) / 2;
int g = Guess(nask);
if(ask > nask) g = -g;
if(g == 1) l = mid + 1;
else if(g == -1) r = mid - 1;
else return (ask + nask) / 2;
ask = nask;
}
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... |