Submission #894752

#TimeUsernameProblemLanguageResultExecution timeMemory
894752___Guess the number (BOI20_guess)C++14
0 / 100
1 ms600 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin>>n; int l=0,r=n; while(1) { long int m=(r+l)/2,x; cout<<"? "<<m<<endl; cin>>x; if(x==1) { r=m; } else if(x==0) { cout<<"= "<<m; break; } else { l=m; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...