
ACM - SPFA算法
LP_Cong
Python, Qt C++ Developer ACMer https://github.com/Linzecong
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ - 1797 Heavy Transportation(最短路变形,SPFA,Dijkstra)
解题思路:最短路变形题,求两点之间经过的路的最大值。普通的最短路是求最短的路径的和,因此只要把求和改成求最大即可。详细见代码!原创 2017-07-26 11:23:31 · 555 阅读 · 0 评论 -
POJ - 2387 Til the Cows Come Home(Dijkstra SPFA 邻接矩阵 邻接表)
最短路的模板题,以这题为例子,介绍各种最短路算法,和图的各种表示。这里介绍了经典Dijkstra算法和,队列优化的Bell算法,即Spfa算法。Dijkstra算法不能解决负环,而Spfa可以,本例中,spfa返回1代表有负环,0代表没有。算法具体解释参考其他博文原创 2017-07-25 10:31:44 · 622 阅读 · 0 评论 -
HDU - 6165 FFF at Valentine
FFF at ValentineProblem DescriptionAt Valentine's eve, Shylock and Lucar were enjoying their time as any other couples. Suddenly, LSH, Boss of FFF Group caught both of them, and locked t原创 2017-08-22 17:25:49 · 419 阅读 · 0 评论 -
HDU - 6201 transaction transaction transaction (2017 ACM-ICPC 亚洲区 (沈阳赛区) 网络赛 1008)
transaction transaction transactionProblem DescriptionKelukin is a businessman. Every day, he travels around cities to do some business. On August 17th, in memory of a great man, citizens wi原创 2017-09-11 00:11:06 · 837 阅读 · 0 评论 -
GYM - 100812G Short Path (SPFA+思维)
Short Pathtime limit per test2.0 smemory limit per test256 MBinputstandard inputoutputstandard outputIn my opinion, people are divided into two categories: some原创 2017-12-02 19:37:07 · 364 阅读 · 0 评论