Submission #919493

#TimeUsernameProblemLanguageResultExecution timeMemory
919493NK_Mađioničar (COI22_madionicar)C++17
0 / 100
867 ms344 KiB
// Success consists of going from failure to failure without loss of enthusiasm #include <bits/stdc++.h> using namespace std; #define nl '\n' template<class T> using V = vector<T>; using vi = V<int>; int main() { cin.tie(0)->sync_with_stdio(0); int N; cin >> N; auto ask = [&](int l, int r) { if (l < 0 || r >= N) return 0; cout << "? " << l + 1 << " " << r + 1 << endl; int res; cin >> res; return res; }; int odd = 0, even = 0; for(int i = 0; i < N; i++) { while(ask(i - odd - 1, i + odd + 1)) odd++; while(ask(i - even, i - even + 1)) even++; } cout << "! " << max(2 * odd + 1, 2 * even) << endl; exit(0-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...