并查集
文章平均质量分 82
感觉自己就是个bug
这个作者很懒,什么都没留下…
展开
-
PAT(甲级)2019年春季考试7-3 Telefraud Detection (25 分)
Telefraud Detection (25分)主要注重题目细节#include<bits/stdc++.h>using namespace std;int phone[1005][1005]={0},phone1[1005][1005]={0};vector<int>v[1005],w[1005];bool visit[1005][1005]={false},is[1005]={false},vs[1005]={false};void DFS(int root,in原创 2020-06-12 14:53:41 · 278 阅读 · 0 评论 -
PAT(甲级)2020年冬季考试7-3 File Path (25分)
7-3File Path(25分)The figure shows the tree view of directories in Windows File Explorer. When a file is selected, there is a file path shown in the above navigation bar. Now given a tree view of directories, your job is to print the file path for any sel原创 2021-03-10 10:58:22 · 269 阅读 · 1 评论 -
1107 Social Clusters (30 分)
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原创 2021-02-28 15:29:16 · 59 阅读 · 0 评论 -
1114 Family Property (25 分)
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原创 2021-02-26 12:58:20 · 91 阅读 · 0 评论 -
1118 Birds in Forest (25分)并查集的应用
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 fo原创 2020-05-30 09:02:26 · 84 阅读 · 0 评论