正文
增加 5 行删除 5 行
66 行未改动6768697071727374758 行未改动8485868788899091925 行未改动989910010110210310410510610710810939 行未改动14915015115215315415515615715 行未改动66 行未改动namespace ARIS0_0{int a, x, b, v[N];vector <int> pos[N];void init(){}void erase(int a, int b){if (pos[a].back() == b) pos[a].pop_back();8 行未改动int t = x;x = pos[t][0], y = pos[t][1];}else x = pos[x][0], y = pos[y][0];if (x > y) swap(x, y);erase(v[x], x), erase(v[y], y);v[x] = (v[x] + v[y]) / 2;pos[v[x]].push_back(x);5 行未改动if (x == a || x == b){cout << "-1\n";return ;}b -= a, x -= a;for (int i = 0; i <= b; i ++ ) v[i] = i, pos[i].push_back(i);if (b == 2){out(0, 2), out(1, 1);return ;}39 行未改动out(1, b), out((b + 1) / 2, (b + 1) / 2);for (int i = 2; i <= b - 1; i ++ ) out(i - 2, i);return ;}out(0, 2), out(1, 1);for (int i = 3; i < x; i ++ ) out(i - 2, i);out(b, b - 2), out(b - 1, b - 2);for (int i = b - 3; i > x; i -- ) out(i, i + 2);15 行未改动66 行未改动6768697071727374758 行未改动8485868788899091925 行未改动989910010110210310410510610710810939 行未改动14915015115215315415515615715 行未改动66 行未改动namespace ARIS0_0{int a, x, b, v[N];vector <int> pos[N];void init(){}void erase(int a, int b){if (pos[a].back() == b) pos[a].pop_back();8 行未改动int t = x;x = pos[t][0], y = pos[t][1];}else x = pos[x][0], y = pos[y][0];if (x > y) swap(x, y);erase(v[x], x), erase(v[y], y);v[x] = (v[x] + v[y]) / 2;pos[v[x]].push_back(x);5 行未改动if (x == a || x == b){cout << "-1\n";return ;}b -= a, x -= a;for (int i = 0; i <= b; i ++ ) v[i] = i, pos[i].push_back(i);if (b == 2){out(0, 2), out(1, 1);return ;}39 行未改动out(1, b), out((b + 1) / 2, (b + 1) / 2);for (int i = 2; i <= b - 1; i ++ ) out(i - 2, i);return ;}out(0, 2), out(1, 1);for (int i = 3; i < x; i ++ ) out(i - 2, i);out(b, b - 2), out(b - 1, b - 2);for (int i = b - 3; i > x; i -- ) out(i, i + 2);15 行未改动