没有压缩路径啊,把find()里面return find(fa[x])改成return fa[x]=find(fa[x]);
by D10s @ 2017-11-08 20:12:57
@[cf1416207159](/space/show?uid=44052)
by D10s @ 2017-11-08 20:13:29
@[D10s](/space/show?uid=33426) 谢谢大佬
by cf1416207159 @ 2017-11-08 20:18:24