hdu3047专题

hdu3047 带权并查集

带权并查集 #include <iostream>#include <cstring>using namespace std;int father[50005];int rank[50005];int n,m;int find(int x){if (x == father[x])return x;int t = father[x];father[x] = find(father[x]