并查集(路径压缩)

int fdf(int x){
	return fa[x]==x?x:(fa[x]=fdf(fa[x]));//注意括号
}

void uni(int x,int y){//合并x所在的集合与y所在的集合为一个集合
	fa[fdf(x)]=fdf(y);
}