#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(r-l>1){
ll x=Guess(last),mid=(l+r)/2;
if(last==r){
if(x==-1) r=mid;
else l=mid;
}
else{
if(x==-1) l=mid;
else r=mid;
}
last=mid;
}
if(l==r) return l;
else{
if(last==l){
ll x=Guess(r);
if(x==1) return r;
return l;
}
else{
ll x=Guess(l);
if(x==1) return l;
return r;
}
}
}
# | 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... |