并查集-最大连通块

牛客上的不知道哪一题......

就是在并查集的基础上求最大连通块

只需要额外添加一个统计大小的数组就行

image

posted @ 2026-10-14 16:02  yi_one  阅读(6)  评论(0)    收藏  举报