
最小生成树
xuanweiace
一个热爱算法竞赛的弱校ACMer路过。青大本,浙大硕,方向后端开发,菜鸡一枚,奋斗ing...
展开
-
【HDU - 1301】Jungle Roads(并查集+最小生成树)(内附最小生成树两种算法 克鲁斯特尔算法&&普里姆算法)
题干:Jungle RoadsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5505 Accepted Submission(s): 3976Problem DescriptionThe Head Elder of...原创 2018-07-16 23:44:30 · 227 阅读 · 0 评论 -
【FZU - 2254】英语考试(最小生成树,思维,建图)
题干:在过三个礼拜,YellowStar有一场专业英语考试,因此它必须着手开始复习。这天,YellowStar准备了n个需要背的单词,每个单词的长度均为m。YellowSatr准备采用联想记忆法来背诵这n个单词:1、如果YellowStar凭空背下一个新词T,需要消耗单词长度m的精力2、如果YellowSatr之前已经背诵了一些单词,它可以选择其中一个单词Si,然后通过联想记忆...原创 2019-03-25 22:47:17 · 218 阅读 · 0 评论 -
【HDU - 5627】Clarke and MST(最大生成树,与运算性质,最小生成树MST变形)
题干:Clarke is a patient with multiple personality disorder. One day he turned into a learner of graph theory.He learned some algorithms of minimum spanning tree. Then he had a good idea, he wanted ...原创 2019-03-26 08:37:15 · 550 阅读 · 0 评论 -
【HDU - 6187】Destroy Walls(思维,最大生成树)
题干:Long times ago, there are beautiful historic walls in the city. These walls divide the city into many parts of area.Since it was not convenient, the new king wants to destroy some of these wall...原创 2019-04-10 10:13:02 · 366 阅读 · 0 评论 -
【LightOJ - 1123】Trail Maintenance(在线维护最小生成树,删边思维)
题干:Tigers in the Sunderbans wish to travel freely among theNfields (numbered from1toN), even though they are separated by trees. The tigers wish to maintain trails between pairs of fields so th...原创 2019-05-03 14:22:12 · 498 阅读 · 2 评论 -
【POJ - 3026】Borg Maze(bfs预处理 + 最小生成树,建图)
题干:The 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 civilizati...原创 2019-05-04 16:14:00 · 254 阅读 · 0 评论 -
【2018ACM山东省赛 - C】Cities(最小生成树变形优化,贪心思维)
题干:Problem DescriptionThere are nnn cities in Byteland, and the ithi_{th}ith city has a value aia_iai. The cost of building a bidirectional road between two cities is the sum of their values. Pl...原创 2019-05-09 21:27:17 · 390 阅读 · 0 评论 -
【POJ - 2253】Frogger(floyd,或 部分瓶颈生成树的最大边)
题干:湖中有n块石头,编号从1到n,有两只青蛙,Bob在1号石头上,Alice在2号石头上,Bob想去看望Alice,但由于水很脏,他想避免游泳,于是跳着去找她。但是Alice的石头超出了他的跳跃范围。因此,Bob使用其他石头作为中间站,通过一系列的小跳跃到达她。两块石头之间的青蛙距离被定义为两块石头之间所有可能路径上的最小必要跳跃距离,某条路径的必要跳跃距离即这条路径中单次跳跃的最远跳跃距离...原创 2019-05-09 21:29:01 · 194 阅读 · 0 评论 -
【HDU - 4786 】Fibonacci Tree (最小生成树变形,上下界贪心,tricks)
题干: Coach Pang is interested in Fibonacci numbers while Uncle Yang wants him to do some research on Spanning Tree. So Coach Pang decides to solve the following problem: Consider a bidirectional g...原创 2019-07-04 10:19:10 · 367 阅读 · 0 评论 -
【POJ - 3723】Conscription (最大生成树,最小生成树MST变形)
题干:Windy has a country, and he wants to build an army to protect his country. He has picked upNgirls andMboys and wants to collect them to be his soldiers. To collect a soldier without any privi...原创 2019-03-25 22:28:00 · 353 阅读 · 0 评论 -
【POJ - 2728】Desert King (最有比率生成树,分数规划)
题干:David the Great has just become the king of a desert country. To win the respect of his people, he decided to build channels all over his country to bring water to every village. Villages which a...原创 2019-02-24 22:05:36 · 248 阅读 · 0 评论 -
【HDU - 1863】 畅通工程(并查集+最小生成树)
题干:省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 Input测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( < 100 );随后的 N 行对应村庄间...原创 2018-07-16 23:44:16 · 219 阅读 · 0 评论 -
【POJ - 1287】 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 connect pairs...原创 2018-07-16 23:44:24 · 280 阅读 · 0 评论 -
【POJ - 1789】【ZOJ - 2158】【SCU - 1832】Truck History (最小生成树)
题干:DescriptionAdvanced 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...原创 2018-07-20 00:04:46 · 312 阅读 · 0 评论 -
【OpenJ_Bailian - 1258】【POJ - 1258】Agri-Net (最小生成树裸题)
题干:Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course. Farmer John ordered a hig...原创 2018-08-31 13:39:27 · 374 阅读 · 0 评论 -
【HDU - 1102】Constructing Roads (最小生成树裸题模板)
题干:There 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 connected, if and only...原创 2018-12-26 15:42:56 · 272 阅读 · 0 评论 -
【POJ - 2377】Bad Cowtractors (最大生成树,并查集)
题干:Bessie has been hired to build a cheap internet network among Farmer John's N (2 <= N <= 1,000) barns that are conveniently numbered 1..N. FJ has already done some surveying, and found M (1...原创 2018-11-24 12:18:27 · 278 阅读 · 0 评论 -
【牛客 - 330G】Applese 的毒气炸弹(最小生成树,构造,判连通图)
题干: 众所周知,Applese 是个很强的选手,它的化学一定很好。今天他又AK了一套题觉得很无聊,于是想做个毒气炸弹玩。毒气炸弹需要 k 种不同类型元素构成,Applese一共有 n 瓶含有这些元素的试剂。已知元素混合遵循 m 条规律,每一条规律都可以用 "x y c" 描述。表示将第 x 瓶试剂混入第 y 瓶试剂或者把第 y 瓶试剂混入第 x 瓶试剂,需要消耗 c 的脑力。...原创 2019-01-29 22:05:02 · 226 阅读 · 0 评论 -
【POJ - 2485 】Highways (最小生成树,Prim算法,瓶颈生成树)
题干:The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has no public highways. So the traffic is difficult in Flatopia. The Flatopian government is aware of this problem. They'r...原创 2019-02-21 15:42:49 · 316 阅读 · 0 评论 -
【HDU - 5922】Minimum’s Revenge(思维,最小生成树变形)
题干:There is a graph of n vertices which are indexed from 1 to n. For any pair of different vertices, the weight of the edge between them is theleast common multipleof their indexes.Mr. Frog is wo...原创 2019-09-13 16:51:27 · 403 阅读 · 0 评论