L3-003 社交集群 [并查集]
摘要:
这题题意就是只要两个人有共同的兴趣爱好就可以把他们放到一个集合里面,问你有多少个人数不同的集合。 简单并查集,多一步集合计数,详见代码 #include <iostream> #include <string.h> #include <cstdio> #include <algorithm> #in 阅读全文
posted @ 2019-03-11 17:34 FTA_Macro 阅读(142) 评论(0) 推荐(0) 编辑