两种并查集 Posted Sep 8, 2023 By 1 min read模板 1 2 3 int find(int x){ return par[x]==x?x:par[x]=find(par[x]); } 种类(扩展域)并查集开多倍空间,维护种类间的关系带权并查集定义$ dis_i 为i到根节点的关系,实际是求dis_fx $ 并查集 并查集 This post is licensed under CC BY 4.0 by the author. Share