Submission #637977

#TimeUsernameProblemLanguageResultExecution timeMemory
637977mannshah1211Colors (BOI20_colors)C++14
0 / 100
0 ms208 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n; cin >> n; ll lo = 1, hi = n, mid = -1; while(lo <= hi){ mid = (lo + hi)/2; cout << "?" << ' ' << mid << endl; ll x; cin >> x; if(x == 1){ hi = mid - 1; } else{ lo = mid + 1; } } cout << "=" << ' ' << mid << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...