随笔分类 - ACM--最小生成树
摘要:题目大意: 有n个城市,秦始皇要修用n-1条路把它们连起来,要求从任一点出发,都可以到达其它的任意点。秦始皇希望这所有n-1条路长度之和最短。然后徐福突然有冒出来,说是他有魔法,可以不用人力、财力就变出其中任意一条路出来。 秦始皇希望徐福能把要修的n-1条路中最长的那条变出来,但是徐福希望能把要求的
阅读全文
摘要:题意: 求最小生成树中,最大的边减去最小的边 最小值。 看了题解发现真简单=_= 将每条边进行从小到大排序,然后从最小到大一次枚举最小生成树,当构成生成树的时候,更新最小值 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring>
阅读全文
摘要:The Unique MSTTime Limit:1000MSMemory Limit:10000KTotal Submissions:25203Accepted:8995DescriptionGiven a connected undirected graph, tell if its minim...
阅读全文
摘要:Truck HistoryTime Limit:2000MSMemory Limit:65536KTotal Submissions:22648Accepted:8781DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different...
阅读全文
摘要:HighwaysTime Limit:1000MSMemory Limit:65536KTotal Submissions:26516Accepted:12136DescriptionThe island nation of Flatopia is perfectly flat. Unfortuna...
阅读全文
摘要:Agri-NetTime Limit:1000MSMemory Limit:10000KTotal Submissions:46811Accepted:19335DescriptionFarmer John has been elected mayor of his town! One of his...
阅读全文