#include<bits/stdc++.h>
#include "grader.h"
#define ll long long
#define co cout<<
using namespace std;
// stuff
int HC(int N){
ll l=1,r=N,last=r;
Guess(l);
while(l<r){
ll x;
if(l==last) x=Guess(r);
else x=Guess(l);
ll mid=(l+r)/2;
if(x==0) return mid;
if(last==r){
if(x==-1) r=mid-1;
else l=mid;
}
else{
if(x==-1) l=mid+1;
else r=mid;
}
last=mid;
}
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... |