版本比较
题解:CF2190C Comparable Permutations
正文
增加 2 行删除 2 行
15 行未改动161718192021222324252627282946 行未改动15 行未改动#include <bits/stdc++.h>using namespace std;int query(int x, int y) {cout << "? " << x << ' ' << y << endl;int res; cin >> res;if (res == -1) exit(0);return res;}void solve() {int n, pos1 = -1, pos2;cin >> n; pos2 = n;vector<int> a(n + 10), ans(n + 10);for (int i = 1; i < n; i++)a[i] = query(i, i + 1);46 行未改动15 行未改动161718192021222324252627282946 行未改动15 行未改动#include <bits/stdc++.h>using namespace std;int query(int x, int y) {cout << "? " << x << ' ' << y << endl;int res; cin >> res;if (res == -1) exit(0);return res;}void solve() {int n, pos1 = -1, pos2;cin >> n; pos2 = n;vector<int> a(n + 10), ans(n + 10);for (int i = 1; i < n; i++)a[i] = query(i, i + 1);46 行未改动