版本比较
题解:P14007 查询游戏
正文
增加 1 行删除 6 行
17 行未改动18192021222224232425268 行未改动353637384142433940414225 行未改动68697071777273747517 行未改动最后回答区间 $[l_x,r_y]$ 即可。
```cpp#include <bits/stdc++.h>// #define int long long#define lint long long// #define endl '\n'using namespace std;const int N = 1e5+5;
struct node{8 行未改动signed main(){ ios::sync_with_stdio(0); cin.tie(0);
// freopen("app.in","r",stdin); // freopen("app.out","w",stdout); cin >> n;
for(int i = 1; i <= n; i++){ cout << "? " << i << " " << i << endl;25 行未改动 if(v[l].b == input) r = i; } }
cout << "! " << v[l].l << " " << v[r].r << endl; cout << "! " << v[l].l << " " << v[r].r << endl; return 0;}```