並查集的常見用法模板

const int maxn = 1000000 + 10; const int INF = int(1e9); using namespace std; int fa[maxn]; //父親結點 int Rank[maxn]; //樹的的高度 void init(int n) //初始化全部結點 { for (int i = 0; i < n; i++) { fa[i] = i;
相關文章
相關標籤/搜索