版本比较
码风
正文
增加 2 行删除 2 行
30 行未改动313233343535363738399 行未改动4950515253535455565712 行未改动30 行未改动 else { cnt++; if (cnt == x) lst = i, r++, fa[i] = i, cnt = 0; } } } } ans = max(ans, x * r); return res[x] = r;}9 行未改动 while (t--) { n = read(), m = n << 1; L(i, 1, n) l[i] = read(); L(i, 1, n) r[i] = read(); L(i, 1, m) x[i].clear(), y[i].clear(); L(i, 1, m) x[i].clear(), y[i].clear(); L(i, 1, n) res[i] = -1, x[l[i]].pb(i), y[r[i]].pb(i); tot = 0, ans = 0; L(i, 1, m) { for (auto t : x[i]) l[t] = ++tot;12 行未改动