摘要:
merge 其实有一个很吊的函数:merge #include <bits/stdc++.h> using namespace std; int main() { vector<int> fi={5,10,15,20,25}; vector<int> se={7,17,27,37,47,57}; v 阅读全文
posted @ 2026-04-11 15:27
wtnbl
阅读(5)
评论(0)
推荐(0)
摘要:
int findf(int x) { int root = x; while(fa[root] != root) root = fa[root]; // 先找到根 // 路径压缩 while(x != root) { int nxt = fa[x]; fa[x] = root; x = nxt; } 阅读全文
posted @ 2026-04-11 10:36
wtnbl
阅读(4)
评论(0)
推荐(0)

浙公网安备 33010602011771号