Submission #975451

#TimeUsernameProblemLanguageResultExecution timeMemory
975451Error404Guess the number (BOI20_guess)C++17
100 / 100
1 ms596 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define f first #define s second #define pb push_back #define pi pair<int,int> int main(){ int n; cin >> n; int l = 1, r = n; while(l<=r){ int m = (l+r)/2; cout << "? "<< m << endl; cout << flush; int ans; cin >> ans; if(ans==0){ cout << "= " << m << endl; return 0; } else if(ans==1){ r = m-1; } else l = m+1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...