
并查集
文章平均质量分 68
ThisIsSonic
守得云开见月明
展开
-
The Suspects 并查集
Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to separate the suspects from others. In the Not-Spreading-Y原创 2022-06-17 09:57:23 · 200 阅读 · 1 评论 -
Wireless Network 并查集
An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the network were all broken. The computers are repaired one b原创 2022-06-16 22:37:15 · 194 阅读 · 0 评论 -
朋友(并查集)
朋友(并查集) 题目描述 有一个城镇,住着n个市民。已知一些人互相为朋友。引用一个名人的话说,朋友的朋友也是朋友。意思是说如果A和B是朋友,C和B是朋友,则A和C是朋友.你的任务是数出最大朋友组的人数。 输入 输入第一行由N,M组成,N是市民的个数(1<=n<=30000),m是朋友对的个数(0<=m<=500000)。下面的m行每一行由两个数A和B组成(1<=A,B<=N,A<>B)表示A和B是朋友。注意给的朋友对可能会有重复。 输出 输出仅有一原创 2021-05-19 09:42:11 · 396 阅读 · 0 评论