
并查集/最小生成树
文章平均质量分 81
YOONGI
这个作者很懒,什么都没留下…
展开
-
How Many Tables
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 frien...原创 2018-01-22 11:47:02 · 161 阅读 · 0 评论 -
POJ - 2236 Wireless Network (并查集)
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...原创 2018-11-27 21:43:30 · 124 阅读 · 0 评论 -
QS Network ZOJ - 1586 (最小生成树 Kruskal)
QS NetworkSunny Cup 2003 - Preliminary RoundApril 20th, 12:00 - 17:00Problem E: QS NetworkIn the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate...原创 2019-02-28 20:43:48 · 122 阅读 · 0 评论 -
POJ - 1789 Truck History (最小生成树 Kruskal)
Truck HistoryAdvanced Cargo Movement, Ltd. uses trucks of different types. Some trucks are used for vegetable delivery, other for furniture, or for bricks. The company has its own code describing...原创 2019-02-28 21:09:21 · 119 阅读 · 0 评论 -
POJ - 2349 Arctic Network (最小生成树 Kruskal)
Arctic NetworkThe Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing t...原创 2019-03-01 16:52:42 · 182 阅读 · 0 评论 -
牛客练习赛41 抓捕盗窃犯 (并查集)
链接:https://ac.nowcoder.com/acm/contest/373/C来源:牛客网题目描述Q市发生了一起特大盗窃案。这起盗窃案是由多名盗窃犯联合实施的,你要做的就是尽可能多的抓捕盗窃犯。已知盗窃犯分布于NN个地点,以及第ii个地点初始有aiai名盗窃犯。特别的是,对于每一个地点uu,都有一个固定的地点vv--当前如果某个盗窃犯位于地点uu...原创 2019-03-09 11:09:11 · 232 阅读 · 0 评论 -
CodeForces - 731C Socks (并查集)
SocksArseniy is already grown-up and independent. His mother decided to leave him alone formdays and left on a vacation. She have prepared a lot of food, left some money and washed all Arseniy'...原创 2019-03-29 16:23:07 · 307 阅读 · 0 评论 -
HDU - 3038 How Many Answers Are Wrong (带权并查集)
How Many Answers Are Wrong题目链接:https://vjudge.net/problem/HDU-3038TT and FF are ... friends. Uh... very very good friends -________-bFF is a bad boy, he is always wooing TT to play the following...原创 2019-04-04 10:15:31 · 120 阅读 · 0 评论 -
POJ - 3026 Borg Maze (BFS + 最小生成树)
Borg MazeThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Borg civi...原创 2019-03-28 15:24:15 · 120 阅读 · 0 评论 -
CodeForces - 1167C News Distribution (并查集)
News DistributionIn some social network, there arennusers communicating with each other inmmgroups of friends. Let's analyze the process of distributing some news between users.Initially, s...原创 2019-08-02 17:25:51 · 287 阅读 · 0 评论 -
Gym - 100923H Por Costel and the Match (并查集)
Por Costel and the MatchOberyn Martell and Gregor Clegane are dueling in a trial by combat. The fight is extremely important, as the life of Tyrion Lannister is on the line. Oberyn and Gregor are...原创 2019-08-01 10:38:45 · 144 阅读 · 0 评论 -
POJ - 1988 Cube Stacking (并查集)
Cube StackingFarmer John and Betsy are playing a game with N (1 <= N <= 30,000)identical cubes labeled 1 through N. They start with N stacks, each containing a single cube. Farmer John asks Be...原创 2018-11-27 14:43:37 · 191 阅读 · 0 评论 -
Slim Span
Slim SpanGiven an undirected weighted graph G, you should find one of spanning trees specified as follows.The graph G is an ordered pair (V, E), where V is a set of vertices {v1, v2, …, vn} and E ...原创 2018-07-17 17:05:59 · 125 阅读 · 0 评论 -
Supermarket
Supermarket A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting fro原创 2018-01-08 10:10:58 · 664 阅读 · 0 评论 -
The Suspects
The SuspectsSevere 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 b...原创 2018-01-17 15:19:23 · 177 阅读 · 0 评论 -
畅通工程
畅通工程 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( 注意:两个城市之间可以有多条道路相通,原创 2018-01-19 20:08:53 · 163 阅读 · 0 评论 -
Rumor
Rumor Vova promised himself that he would never play computer games... But recently Firestorm — a well-known game developing company — published their newest game, World of Farcraft, and it beca原创 2018-01-19 20:25:10 · 907 阅读 · 0 评论 -
还是畅通工程
还是畅通工程某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随后的N(N-1)/2行对应村庄间的...原创 2018-03-14 21:01:44 · 857 阅读 · 0 评论 -
Networking (最小生成树 Kruskal)
Networking You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may co...原创 2018-03-14 21:03:44 · 259 阅读 · 0 评论 -
Jungle Roads(最小生成树 Kruskal)
Jungle Roads The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes ro...原创 2018-04-06 15:12:20 · 551 阅读 · 0 评论 -
Building a Space Station
Building a Space Station You are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a computer program to com...原创 2018-04-06 15:36:27 · 139 阅读 · 0 评论 -
Constructing Roads
Constructing RoadsThere are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A and B are conn...原创 2018-04-06 15:50:56 · 122 阅读 · 0 评论 -
英语考试
英语考试在过三个礼拜,YellowStar有一场专业英语考试,因此它必须着手开始复习。这天,YellowStar准备了n个需要背的单词,每个单词的长度均为m。YellowSatr准备采用联想记忆法来背诵这n个单词:1、如果YellowStar凭空背下一个新词T,需要消耗单词长度m的精力2、如果YellowSatr之...原创 2018-07-17 10:04:52 · 213 阅读 · 0 评论 -
CodeForces - 500B New Year Permutation (并查集)
New Year PermutationUser ainta has a permutationp1, p2, ..., pn. As the New Year is coming, he wants to make his permutation as pretty as possible.Permutationa1, a2, ..., anisprettierthan ...原创 2019-08-02 14:44:46 · 231 阅读 · 0 评论