제출 #894748

#제출 시각아이디문제언어결과실행 시간메모리
894748___Guess the number (BOI20_guess)C++14
0 / 100
0 ms432 KiB
#include <iostream> using namespace std; int main() { int n; cin>>n; int l=0,r=n; while(1) { int m=(r+l)/2,x; cout<<"? "<<m<<endl; cin>>x; if(x==1) { l=m; } else if(x==0) { cout<<"= "<<m; break; } else { r=m; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...