# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
864681 | Trisanu_Das | Mađioničar (COI22_madionicar) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}