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"
int HC(int N){
//int g = Guess(1);
int lo=1;
int hi=N;
int lmid;
int rmid;
int res;
while (lo<hi) {
lmid=lo+(hi-lo)/3;
rmid=hi-(hi-lo)/3;
Guess(lmid);
res=Guess(rmid);
if (res==0) return (lmid+rmid)>>1;
if (res<0) {
//lmid side
hi=((lmid+rmid)>>1)-((rmid-lmid+1)%2);
} else {
//rmid side
lo=((lmid+rmid)>>1)+1;
}
}
return lo;
}
# | 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... |