Submission #1192191

#TimeUsernameProblemLanguageResultExecution timeMemory
1192191prideliqueeeGuess the number (BOI20_guess)C++20
0 / 100
0 ms412 KiB
#include<bits/stdc++.h> using namespace std; #define int long long signed main() { int n; cin>>n; int l=1,r=n; while(l<r) { int mid=(l+r)/2; cout<<"? "<<mid<<endl; int x; cin>>x; if(x==0) { cout<<"= "<<mid; return 0; } if(x==1) { r=mid-1; } else if(x==-1) { l=mid+1; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...