
并查集
并查集
繁星蓝雨
Happy coding!
-
原创 并查集应用————好朋友
1 题目 Sample Inpu1t: 4 2 1 4 2 3 Sample Output1: 2 Sample Input2: 7 5 1 2 2 3 3 1 1 4 5 6 Sample Output2: 3 2 解析 2.1 题意 给出数码宝贝的个数与关系,给出数码宝贝分成的组数 2.2 思路 给出的组数实际为并查集的集合个数 1 用给出的关系建立并查集 2 用一个专门的数组查来记录...2020-02-11 23:55:2197
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:01114
0