Submission #515533

#TimeUsernameProblemLanguageResultExecution timeMemory
515533rajatshenoiColors (BOI20_colors)C++14
9 / 100
2 ms284 KiB
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int N; cin >> N; int j = 0; int k = 1; bool bre = false; for (int i = 1; i <= N; i++) { if (i % 2 == 1) { cout << "? " << k << endl; int ans; cin >> ans; if (ans == 0 and i != 1) { cout << "= " << (N - i + 2) << endl; bre = true; break; } k++; } else { cout << "? " << (N - j) << endl; int ans; cin >> ans; if (ans == 0) { cout << "= " << (N - i + 2) << endl; bre = true; break; } j++; } } if (!bre) cout << "= 1" << endl; 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...