Submission #680505

#TimeUsernameProblemLanguageResultExecution timeMemory
680505jhwest2Colors (BOI20_colors)C++17
0 / 100
0 ms208 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll n; bool ask(ll n) { bool res; cout << "? " << n << endl; cin >> res; return res; } int main() { cin >> n; ll L = 1, R = n; ll x = n / 3, dir = 0; ask(x); while (L < R) { ll M = (L + R + 1) / 2; bool r; if (dir == 0) { r = ask(x + M); x += M; } else { r = ask(x - M); x -= M; } dir = 1 - dir; if (r) R = M; else L = M + 1; } cout << "= " << L << 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...