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"
///Subtask 3
///Binary Search with the fact that we can get "same"
int HC(int N){
int L=1,R=N;
while(L<R){
int mid=(L+R)/2;
Guess(L);
int ans=Guess(R);
if(ans==0)
return mid;
if(ans==1)
L=mid+1;
else{
if((L-R+1)%2==0)
R=mid;
else
R=mid-1;
}
}
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... |