int get(x){ if(x==fa[x]) { return x; //返回根节点 } else { return fa[x]=get(fa[x]); //让父亲节点为根节点 }}
void merge(int x,int y){ fa[get(x)]=get(y);}