并查集并查集是一种用来管理元素分组情况的数据结构。朴素并查集(带路径压缩)<pre<code//每个点的父亲节点intpN;//每个集合的大小intszN;voidinit(intn){for(inti1;i<n;i