Open xjzsq opened 5 years ago
http://www.xjdesyxx.top/2018/02/21/unionfind/
find函数应该写成:
inline int find(int a) { if(fa[a]!=a)return fa[a]=find(fa[a]); return fa[a]; }
不然没有路径压缩的效果...
http://www.xjdesyxx.top/2018/02/21/unionfind/