并查集
是
baixiaofei567
如果十年前没种树,那最好的时间是现在
展开
-
19春第三题 PAT甲级 1158 Telefraud Detection (25分)
Telefraud(电信诈骗) remains a common and persistent problem in our society. In some cases, unsuspecting victims lose their entire life savings. To stop this crime, you are supposed to write a program to detect those suspects from a huge amount of phone call re原创 2020-11-29 02:02:22 · 366 阅读 · 2 评论 -
1034 Head of a Gang (30分)
One way that the police finds the head of a gang is to check people’s phone calls. If there is a phone call between A and B, we say that A and B is related. The weight of a relation is defined to be the total time length of all the phone calls made between原创 2020-10-19 00:37:35 · 104 阅读 · 0 评论 -
1118 Birds in Forest (25分)
Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are supposed to help the scientists to count the maximum number of trees in the forest, and for any pair of b原创 2020-11-10 01:10:00 · 55 阅读 · 0 评论 -
1114 Family Property (25分)
This time, you are supposed to help us collect the data for family-owned property. Given each person’s family members, and the estate(房产)info under his/her own name, we need to know the size of each family, and the average area and number of sets of their原创 2020-11-09 01:36:52 · 124 阅读 · 0 评论 -
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 of people who have some of their hobbies in common. You are supposed to find all the cl原创 2020-11-07 01:52:34 · 88 阅读 · 0 评论