Submission #1085966

#TimeUsernameProblemLanguageResultExecution timeMemory
1085966not_amirColors (BOI20_colors)C++14
0 / 100
0 ms344 KiB
#include <bits/stdc++.h> using namespace std; int solve(int n, int c, int add){ if(n == 1) return 1 + add; int diff = n/2 + add; int q = (c - diff > 0)?c-diff:c+diff; cout << "? " << q << endl; int ans; cin >> ans; if(ans) return solve(n/2, q, add); else return solve(n/2, q, add + n/2); } int main(){ // ios_base::sync_with_stdio(false); // cin.tie(NULL); int n; cin >> n; cout << "? " << n/3 << endl; int ans = solve(n, n/3, 0); cout << "= " << ans; }
#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...