并查集
并查集
繁星蓝雨
Happy coding!
展开
-
并查集应用————好朋友
1 题目Sample Inpu1t:4 21 42 3Sample Output1:2Sample Input2:7 51 22 33 11 45 6Sample Output2:32 解析2.1 题意给出数码宝贝的个数与关系,给出数码宝贝分成的组数2.2 思路给出的组数实际为并查集的集合个数1 用给出的关系建立并查集2 用一个专门的数组查来记录...原创 2020-02-11 23:55:21 · 272 阅读 · 0 评论 -
1107 Social Clusters (30分)
1 题目1107 Social Clusters (30分)When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A social cluster is a set...原创 2020-02-12 10:48:01 · 309 阅读 · 0 评论