版本比较
题解:P7805 [JOI Open 2021] 怪兽游戏 / Monster Game
正文
增加 3 行删除 3 行
128 行未改动全部展开1291301311321331341351361371381391401412 行未改动1441451461471481491501511526 行未改动128 行未改动全部展开for(int i = 0; i < n; i++) id[i] = i;mysort(0, n - 1);for(int i = 0; i < n; i++) ans[i] = id[i];if(dbg) return ans;// check//for(int i = 0; i < n; i++) cerr << id[i] << " "; cerr << "\n";// for(int i = 0; i < n - 1; i++) assert(Query(id[i + 1], id[i]));// solveint a0 = getid(id[0]);if(a0 == 1){if(getid(id[1]) == 1) ans[0] = 1, ans[1] = 0, solve(2);2 行未改动if(getid(id[1]) == n - 2){for(int i = 0; i < n; i++) ans[i] = n - i - 1;} else{for(int i = 0; i < n - 1; i++) ans[i] = n - i - 1;ans[n - 1] = n - 1;}} else{for(int i = 0; i <= a0; i++) ans[i] = a0 - i;solve(a0 + 1);6 行未改动128 行未改动全部展开1291301311321331341351361371381391401412 行未改动1441451461471481491501511526 行未改动128 行未改动全部展开for(int i = 0; i < n; i++) id[i] = i;mysort(0, n - 1);for(int i = 0; i < n; i++) ans[i] = id[i];if(dbg) return ans;// check//for(int i = 0; i < n; i++) cerr << id[i] << " "; cerr << "\n";// for(int i = 0; i < n - 1; i++) assert(Query(id[i + 1], id[i]));// solveint a0 = getid(id[0]);if(a0 == 1){if(getid(id[1]) == 1) ans[0] = 1, ans[1] = 0, solve(2);2 行未改动if(getid(id[1]) == n - 2){for(int i = 0; i < n; i++) ans[i] = n - i - 1;} else{for(int i = 0; i < n - 1; i++) ans[i] = n - i - 1;ans[n - 1] = n - 1;}} else{for(int i = 0; i <= a0; i++) ans[i] = a0 - i;solve(a0 + 1);6 行未改动