제출 #685875

#제출 시각아이디문제언어결과실행 시간메모리
685875null_aweColors (BOI20_colors)C++14
0 / 100
0 ms208 KiB
#include <iostream> using namespace std; #define int long long int n, at; bool qry(int x) { if (at <= n / 2) at += x; else at -= x; cout << "? " << at << endl; bool ans; cin >> ans; return ans; } int32_t main() { cin >> n; bool added = true; at = 1; int test = 0; for (int i = 62; i >= 0; --i) { int chg = test + (1LL << i); if (chg >= n) continue; if (!added) at += 1LL << i; added = !added, test = chg; } cout << "? " << at << endl; int tmp; cin >> tmp; int sum = 0; for (int i = 62; i >= 0; --i) { int chg = sum + (1LL << i); if (chg >= n) continue; if (!qry(chg)) sum = chg; } cout << "= " << sum + 1 << '\n'; return 0; }
#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...