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 L=1;
int R=N-1;
bool f=false;
Guess(1);
while(L!=R){
if(f){
int t=Guess(L);
if(t>0){
L=(L+R+1)/2;
}
if(t==0)return (L+R)/2;
if(t<0){
R=(L+R-1)/2;
}
}
else{
int t=Guess(R);
if(t>0){
R=(L+R-1)/2;
}
if(t==0)return (L+R)/2;
if(t<0){
L=(L+R+1)/2;
}
}
}
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... |