# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
864681 | 2023-10-23T12:22:21 Z | Trisanu_Das | Mađioničar (COI22_madionicar) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> using namespace std; int qry(int x, int y){ int x; cout << "? " << i + 1 << ' ' << j + 1 << endl; cin >> x; return x; } int main(){ int n; cin >> n; int ans = 0, l; for(int t = 0; t < 2; t++){ for(int i = 0, l = t; i < n; i++) while(i > 0 && i + l < n && qry(i - 1, i + l)) i--, l += 2; ans = max(ans, l); } cout << "? " << ans << endl; }