![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Bellman-Ford
文章平均质量分 76
skajre
这个作者很懒,什么都没留下…
展开
-
POJ 1860 Currency Exchange
这题类似于Bellman-Ford,但是不是求负权环,而是求正权环。//// main.cpp// Richard//// Created by 邵金杰 on 16/8/12.// Copyright © 2016年 邵金杰. All rights reserved.//#include#include#includeusing namespace std;c原创 2016-08-13 19:00:35 · 215 阅读 · 0 评论 -
POJ 2240 Arbitrage
又是一道求正权环的水题,不要用c++输入,会超时。总结一下:求正权环时dist数组初始化为0,源点初始化为题目给出的值,若没有,则dist[1]=1;求负权环时,dist输出初始化为无穷大。//// main.cpp// Richard//// Created by 邵金杰 on 16/8/12.// Copyright © 2016年 邵金杰. All rights r原创 2016-08-13 21:11:18 · 169 阅读 · 0 评论 -
POJ 3259 Wormholes(Bellman-Ford判断是否有负权边)
//// main.cpp// Richard//// Created by 邵金杰 on 16/8/12.// Copyright © 2016年 邵金杰. All rights reserved.//#include#includeusing namespace std;#define INF 1<<30struct edges{ int s,e,w原创 2016-08-13 17:42:19 · 246 阅读 · 0 评论 -
UVA 11090 Going in Cycle!(BellmanFord+二分)
自己想的时候只想到强连通缩点的做法,联系不到bellmanford,看了白书之后发现这方法好巧妙。#include#include#include#include#include#includeusing namespace std;const int maxn=50+5;struct edge{ int from,to; double dist;};struc原创 2016-11-19 08:35:53 · 265 阅读 · 0 评论 -
HDU 1535 Invitation Cards(BellmanFord)
#include#include#include#include#include#includeusing namespace std;const int maxn=1000000+5;const int inf=100000000;typedef long long LL;struct edge{ int from,to,dist;};struct Bellman原创 2016-11-19 14:48:49 · 151 阅读 · 0 评论