![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
最短路
文章平均质量分 78
旺旺_碎_冰冰
这个作者很懒,什么都没留下…
展开
-
POJ 2263 Frogger(最大值的最小值) POJ 1797 Heavy Transportation (最小值的最大值)
Freddy 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 tourists' sun原创 2018-01-07 15:44:58 · 220 阅读 · 0 评论 -
浪里个浪 FZU - 2261(最短路好题)
TonyY是一个喜欢到处浪的男人,他的梦想是带着兰兰姐姐浪遍天朝的各个角落,不过在此之前,他需要做好规划。 现在他的手上有一份天朝地图,上面有n个城市,m条交通路径,每条交通路径都是单行道。他已经预先规划好了一些点作为旅游的起点和终点,他想选择其中一个起点和一个终点,并找出从起点到终点的一条路线亲身体验浪的过程。但是他时间有限,所以想选择耗时最小的,你能告诉他最小的耗时是多少吗? ...原创 2018-05-15 10:07:20 · 386 阅读 · 0 评论 -
Funny Car Racing UVA - 12661(最短路好题)
题意:n个城市,m条单向路,每条路有打开的时间a和关闭的时间b轮流交替的,汽车通过这条路需要的时间的t,给出起点和终点,问所需的最短时间是多少?思路:和一般的最短路一样,只是这里的路是一会打开一会关闭的,我们只需要判断一下到了这条路的时候路是打开还是关闭的就好了#include#include#include#include#include#define inf 0x3f原创 2018-04-27 09:06:38 · 203 阅读 · 0 评论 -
POJ 1511 Invitation Cards(优先队列优化后的迪杰斯特拉)
In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They原创 2018-01-19 13:48:11 · 308 阅读 · 0 评论 -
丢三落四的gyr(最短路)
丢三落四的gyrDescription一天gyr从ACM工作室出来以后,突然想玩吃鸡这款游戏,他突然发现自己忘了带电脑,于是他准备去工作室取电脑,但是门卫大爷已经把7教的门锁了,他找不到门卫大爷,他也没有门卫大爷的电话号码。于是他开始给自己认识的同学打电话,询问他们有没有门卫大爷的电话号码,如果没有,他们也会问自己的同学来询问电话号码。那么,gyr最终能联系到门卫大爷么?请你帮原创 2018-03-11 15:50:34 · 187 阅读 · 0 评论 -
一道题搞定所有最短路写法
http://acm.hdu.edu.cn/showproblem.php?pid=1874题目大意:给你一些点,让你求S到T的最短路径。我只是来练习一下SPFA的dijkstra+邻接矩阵[cpp] view plain copy #include #include const int MAXN=200+10; const int转载 2018-01-20 14:23:27 · 375 阅读 · 0 评论 -
POJ 3259 Wormholes (贝尔曼算法判断负环) POJ 1860 Currency Exchange (判断正环) HDU 1217(贝尔曼判断正环)
While 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 time that i原创 2018-01-19 13:22:14 · 269 阅读 · 0 评论 -
PAT 1003 Emergency(最短路(迪杰斯特拉||贝尔曼)最小边权下的最大点权)
1003. Emergency (25)时间限制 400 ms内存限制 65536 kB代码长度限制 16000 B判题程序 Standard 作者 CHEN, YueAs an emergency rescue team leader of a city, you are given原创 2018-01-15 23:17:38 · 422 阅读 · 0 评论 -
最短路算法详解(Dijkstra/SPFA/Floyd)
转自:http://blog.csdn.net/murmured/article/details/19281031一、DijkstraDijkstra单源最短路算法,即计算从起点出发到每个点的最短路。所以Dijkstra常常作为其他算法的预处理。 使用邻接矩阵的时间复杂度为O(n^2),用优先队列的复杂度为O((m+n)logn)近似为O(mlogn)(一) 过程转载 2018-01-16 19:30:33 · 244 阅读 · 0 评论 -
POJ 2387 Til the Cows Come Home(最短路 迪杰斯特拉)
Bessie 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 sleep, so she wants to get b原创 2018-01-06 20:39:30 · 244 阅读 · 0 评论 -
POJ 3660 Cow Contest(最短路弗洛伊德预处理或者迪杰斯克拉)
N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a programming contest. As we all know, some cows code better than others. Each cow has a certain constant skill rating that is原创 2018-01-13 13:22:34 · 277 阅读 · 0 评论 -
两道差分约束(最短路)POJ 3159 Candies POJ 3196 Layout
During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distribute them. All the原创 2018-01-21 10:27:44 · 293 阅读 · 1 评论 -
POJ 3268 Silver Cow Party (最短路,置换矩阵)
One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional (one-way r原创 2018-01-11 21:37:56 · 259 阅读 · 0 评论 -
齐头并进 51Nod - 1649(最短路)
在一个叫奥斯汀的城市,有n个小镇(从1到n编号),这些小镇通过m条双向火车铁轨相连。当然某些小镇之间也有公路相连。为了保证每两个小镇之间的人可以方便的相互访问,市长就在那些没有铁轨直接相连的小镇之间建造了公路。在两个直接通过公路或者铁路相连的小镇之间移动,要花费一个小时的时间。现在有一辆火车和一辆汽车同时从小镇1出发。他们都要前往小镇n,但是他们中途不能同时停在同一个小镇(但是可以同时停在小镇n)...原创 2018-05-15 11:02:10 · 276 阅读 · 0 评论