// 提出時にassertはオフ #ifndef DEBUG #ifndef NDEBUG #define NDEBUG #endif #endif #include using namespace std; using ll = long long; #define ALL(x) (x).begin(), (x).end() template using vec = vector; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; for(int i = 0; i < N - 1; i += 2) { cout << "? " << i << " " << i + 1 << endl; int ans; cin >> ans; if(ans == i) { cout << "! " << i + 1 << endl; return 0; } if(ans == i + 1) { cout << "! " << i << endl; return 0; } } cout << "! " << N - 1 << endl; }