Submission #974172

#TimeUsernameProblemLanguageResultExecution timeMemory
97417212345678Guess the number (BOI20_guess)C++17
100 / 100
1 ms596 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, x; cin>>n; int l=1, r=n; while (1) { int md=(l+r)/2; cout<<'?'<<' '<<md<<endl; cin>>x; if (x==0) return cout<<"= "<<md<<endl, 0; if (x==-1) l=md+1; else r=md-1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...