Submission #255204

#TimeUsernameProblemLanguageResultExecution timeMemory
255204a_playerGuess the number (BOI20_guess)C++14
100 / 100
1 ms384 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; int l=0,r=N+1; while(r-l>1){ int m=l+(r-l)/2; cout<<"? "<<m<<endl; int h; cin>>h; if(h==0){ cout<<"= "<<m<<endl; return 0; }else if(h==1)r=m; else l=m+1; } cout<<"= "<<l<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...