Submission #834959

#TimeUsernameProblemLanguageResultExecution timeMemory
834959vjudge1Colors (BOI20_colors)C++17
0 / 100
1 ms208 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long ll N, X, L, R, mid, tot = 0, tmp = 1, S; int main () { cin >> N; L = 1; R = N; tmp = 1; while(L < R) { mid = (L+R)/2; tot += mid*tmp; tmp *= -1; X = max(X, 1-tot); L = mid+1; } cout << "? " << X << endl; cin >> S; L = 1; R = N; tmp = 1; while(L < R) { mid = (L+R)/2; X += mid*tmp; tmp *= -1; cout << "? " << X << endl; cin >> S; if (S==1) R = mid; else L = mid+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...