Submission #303980

#TimeUsernameProblemLanguageResultExecution timeMemory
303980sofapudenGuess the number (BOI20_guess)C++14
100 / 100
1 ms384 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int lo = 1, hi = n; while(lo < hi){ int mid = (hi+lo)/2; cout << "? " << mid << endl; int x; cin >> x; if(!x){cout << "= " << mid << endl;return 0;} if(x < 0)lo = mid+1; else hi = mid-1; } cout << "= " << lo << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...