Submission #1134817

#TimeUsernameProblemLanguageResultExecution timeMemory
1134817lopkusColors (BOI20_colors)C++20
0 / 100
0 ms432 KiB
#include<bits/stdc++.h> using namespace std; int ask(int n) { cout << "? " << n; cout << endl; int x; cin >> x; return x; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; int l = 1, r = n, c = - 1; while(l <= r) { int mid = (l + r) / 2; ask(1); int ok = ask(mid); if(ok) { r = mid - 1; c = mid; } else { l = mid + 1; } } cout << "= " << c; }
#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...