#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using Pll = pair; using Pii = pair; constexpr ll MOD = 1000000007; constexpr long double EPS = 1e-10; constexpr int dyx[4][2] = { { 0, 1}, {-1, 0}, {0,-1}, {1, 0} }; int main() { int n; cin >> n; vector v(n, -1); v[0] = 1; int cnt = 0; for(int i=2;i<=n;++i) { int ng = -1, ok = i-1; while(ok-ng > 1) { int mid = (ng+ok)/2; cout << "? " << v[mid] << ' ' << i << endl; ++cnt; if(cnt > 334) assert(false); int winner = -1; cin >> winner; if(i == winner) { ok = mid; } else { ng = mid; } } int tmp = i, nxt = i; for(int j=ok;j