图论并查集

#include <bits/stdc++.h> using namespace std; const int MAXN=1e6+7; int p[MAXN]; int _find(int x) { return p[x]==x?x:p[x]=_find(p[x]); } void _union(int x,int y) { int p1=_find(x),p2=_find(
相关文章
相关标签/搜索