标签:模板 bsp const style union max ons logs pre
const int maxn = ; int fa[maxn]; int fi(int x) { return fa[x]==x?x:fa[x]=fi(fa[x]); } void union(int x,int y) { int fx = fi(x),fy = fi(y); if(fx != fy) fa[fx] = fy; } bool check(int x,int y) { int fx = fi(x),fy = fi(y); if(fx == fy) return true; return false; }
标签:模板 bsp const style union max ons logs pre
原文地址:http://www.cnblogs.com/Draymonder/p/7300943.html