
并查集
jiang_16
一个想学好编程的弱渣妹纸,猎奇,脑洞向...
展开
-
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 n原创 2017-08-16 15:42:23 · 191 阅读 · 0 评论 -
How Many Tables
Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friends know each other, a原创 2017-08-16 15:38:55 · 176 阅读 · 0 评论 -
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 s原创 2017-08-15 17:26:16 · 168 阅读 · 0 评论 -
Is It A Tree?
A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties.Th原创 2017-08-16 15:52:45 · 205 阅读 · 0 评论 -
L1-020. 帅到没朋友
当芸芸众生忙着在朋友圈中发照片的时候,总有一些人因为太帅而没有朋友。本题就要求你找出那些帅到没有朋友的人。输入格式:输入第一行给出一个正整数N(<=100),是已知朋友圈的个数;随后N行,每行首先给出一个正整数K(<=1000),为朋友圈中的人数,然后列出一个朋友圈内的所有人——为方便起见,每人对应一个ID号,为5位数字(从00000到99999),ID间以空格分隔;之后给出一个正整数M(<=100原创 2018-03-13 11:31:01 · 239 阅读 · 0 评论 -
L3-1 社交集群(30 分)
当你在社交网络平台注册时,一般总是被要求填写你的个人兴趣爱好,以便找到具有相同兴趣爱好的潜在的朋友。一个“社交集群”是指部分兴趣爱好相同的人的集合。你需要找出所有的社交集群。输入格式:输入在第一行给出一个正整数 N(≤1000),为社交网络平台注册的所有用户的人数。于是这些人从 1 到 N 编号。随后 N 行,每行按以下格式给出一个人的兴趣爱好列表:Ki: hi[1] hi[2]...原创 2018-03-27 16:30:26 · 1287 阅读 · 0 评论