제출 #642308

#제출 시각아이디문제언어결과실행 시간메모리
642308ErennedirloGuess the number (BOI20_guess)C++17
0 / 100
2515 ms208 KiB
#include<bits/stdc++.h> using namespace std; int main(){ cout.tie(0); cin.tie(0); ios_base::sync_with_stdio(0); int N; cin>>N; int left=1, right=N; while(left <= right){ int tmp=(right-left)/2+left; int ans; cout<<"?"<<" "<<tmp<<endl; cin>>ans; if(ans==-1){ right=tmp; } else if(ans==0){ cout<<"= "<<tmp; break; } else{ left=tmp; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...