
最短路
文章平均质量分 83
YOONGI
这个作者很懒,什么都没留下…
展开
-
Frogger (最短路)
FroggerFreddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plans to visit her, but since the water is dirty and full of touris...原创 2018-04-16 20:58:47 · 415 阅读 · 0 评论 -
CodeForces - 449B Jzzhu and Cities (思维+最短路spfa)
Jzzhu and CitiesJzzhu is the president of country A. There arencities numbered from1tonin his country. City1is the capital of A. Also there aremroads connecting the cities. One can go f...原创 2019-07-30 17:10:43 · 216 阅读 · 0 评论 -
HDU - 6026 Deleting Edges (最短路Dijkstra+思维)
Deleting EdgesLittle Q is crazy about graph theory, and now he creates a game about graphs and trees.There is a bi-directional graph withnnnodes, labeled from 0 ton−1n−1. Every edge has its le...原创 2019-05-21 09:52:48 · 227 阅读 · 0 评论 -
HDU-6290 奢侈的旅行 (Dijkstra+堆优化)
奢侈的旅行Problem Description高玩小Q不仅喜欢玩寻宝游戏,还喜欢一款升级养成类游戏。在这个游戏的世界地图中一共有n个城镇,编号依次为1到n。这些城镇之间有m条单向道路,第i条单项道路包含四个参数ui,vi,ai,bi,表示一条从ui号城镇出发,在vi号城镇结束的单向道路,因为是单向道路,这不意味着小Q可以从vi沿着该道路走到ui。小Q的初始等级level为1,每当试图...原创 2019-05-10 15:59:42 · 292 阅读 · 0 评论 -
HDU - 1535 Invitation Cards (反向建边+Dijkstra | spfa)
题目链接:https://vjudge.net/problem/HDU-1535Invitation CardsIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want t...原创 2019-03-27 19:09:41 · 319 阅读 · 0 评论 -
POJ - 1062 昂贵的聘礼 (最短路 spfa)
昂贵的聘礼题目链接:https://vjudge.net/problem/POJ-1062年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就...原创 2019-04-03 21:08:06 · 161 阅读 · 0 评论 -
POJ - 3159 Candies (差分约束 + spfa)
Candies题目链接:https://vjudge.net/problem/POJ-3159During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag ...原创 2019-04-03 20:51:27 · 154 阅读 · 0 评论 -
POJ - 2387 Til the Cows Come Home (Dijkstra模板题)
Til the Cows Come HomeBessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty s...原创 2019-03-25 19:26:48 · 123 阅读 · 0 评论 -
FZU - 2209 老S的旅行计划 (dijkstra)
老S的旅行计划老S在某城市生活的非常不自在,想趁着ICPC举办期间在省内转转。已知老S所在的省有N个城市,M条无向边(对于某一对结点可能出现重边)。由于省内的交通相当糟糕,通过某条边所需要花费的时间受到一天中不同时刻的影响。此外对于某一时刻(一天24小时的任意一个整点算一个时刻),从任何方向通过无向边所需要的时间相同。现在老S想请你帮他规划一下旅行路线。Input第一行输入...原创 2019-03-25 13:41:03 · 340 阅读 · 0 评论 -
find the longest of the shortest
find the longest of the shortestMarica is very angry with Mirko because he found a new girlfriend and she seeks revenge.Since she doesn't live in the same city, she started preparing for the long jo...原创 2018-07-17 15:27:08 · 158 阅读 · 0 评论 -
find the safest road
find the safest roadXX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 ,现在8600 想出去旅游,面对这这么多的路,他想找一条最安全的路。但是8...原创 2018-07-17 10:27:15 · 157 阅读 · 0 评论 -
MPI Maelstrom (dijkstra)
MPI Maelstrom BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee'...原创 2018-04-30 10:21:22 · 219 阅读 · 0 评论 -
Wormholes (Bellman_Ford)
WormholesWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a ti...原创 2018-04-18 14:47:30 · 330 阅读 · 0 评论 -
畅通工程续
畅通工程续某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。 现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题目包含多组数据,请处理到文件结束。 每组数据第一行包含两个正整数N和M(0<N<200,0<...原创 2018-04-03 22:32:42 · 124 阅读 · 0 评论 -
Currency Exchange (Bellman-Ford)
Currency Exchange Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with these cur...原创 2018-04-17 10:46:52 · 187 阅读 · 0 评论 -
POJ - 3268 Silver Cow Party (dijkstra)
Silver Cow PartyOne cow from each ofNfarms (1 ≤N≤ 1000) conveniently numbered 1..Nis going to attend the big cow party to be held at farm #X(1 ≤X≤N). A total ofM(1 ≤M≤ 100,000) uni...原创 2018-04-17 09:41:55 · 138 阅读 · 0 评论 -
POJ - 1797 Heavy Transportation (变形Dijkstra)
Heavy TransportationBackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a w...原创 2018-04-17 09:35:38 · 125 阅读 · 0 评论 -
Gym - 100923B Por Costel and the Algorithm (最短路Dijkstra + 优先队列 +路径记录)
Por Costel and the AlgorithmEven though he isn't a student of computer science, Por Costel the pig has started to study Graph Theory. Today he's learning about Bellman-Ford, an algorithm that cal...原创 2019-08-01 16:35:01 · 231 阅读 · 0 评论