
ACM-图论-最短路
GDUFE_SSS
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 1532 Drainage Ditches 最大网络流
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1532 题意&思路:给出m条河流n个点及河流流量,求最大流 AC代码: #include #include #include #include #define INF 1e9 using namespace std; const int MAX_V=500; struc原创 2017-08-05 16:23:10 · 330 阅读 · 0 评论 -
最短路知识点总结(Dijkstra,Floyd,SPFA,Bellman-Ford)
Dijkstra算法: 解决的问题: 带权重的有向图上单源最短路径问题。且权重都为非负值。如果采用的实现方法合适,Dijkstra运行时间要低于Bellman-Ford算法。 思路: 如果存在一条从i到j的最短路径(Vi.....Vk,Vj),Vk是Vj前面的一顶点。那么(Vi...Vk)也必定是从i到k的最短路径。为了求出最短路径,Dijkstra就提出了转载 2017-09-27 11:06:19 · 357 阅读 · 0 评论 -
POJ - 2240 Arbitrage Floyd
Arbitrage Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 24944 Accepted: 10568 Description Arbitrage is the use of discrepancies in currency exchange rate原创 2017-11-23 20:49:20 · 249 阅读 · 0 评论 -
POJ - 3660 Cow Contest
Cow Contest Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 13409 Accepted: 7465 Description N (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are part原创 2017-11-23 19:58:30 · 277 阅读 · 0 评论 -
POJ - 1502 MPI Maelstrom
MPI Maelstrom Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 10524 Accepted: 6466 Description BIT has recently taken delivery of their new supercomputer,原创 2017-11-23 19:31:01 · 223 阅读 · 0 评论 -
POJ 2195 Going Home 最小费用流
Going Home Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 23975 Accepted: 12034 Description On a grid map there are n little men and n houses. In each uni原创 2017-12-03 21:07:10 · 283 阅读 · 0 评论 -
POJ 2516 Minimum Cost k次最小费用流
Minimum Cost Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 17611 Accepted: 6191 Description Dearboy, a goods victualer, now comes to a big problem, and h原创 2017-12-09 17:42:12 · 354 阅读 · 0 评论 -
POJ 3159 Candies 差分约束-SPFA栈实现
Candies Time Limit: 1500MS Memory Limit: 131072K Total Submissions: 33931 Accepted: 9528 Description During the kindergarten days, flymouse was the monitor of his c原创 2017-11-30 20:38:27 · 281 阅读 · 0 评论 -
POJ 1151 -Invitation Cards- SPFA
Invitation Cards Time Limit: 8000MS Memory Limit: 262144K Total Submissions: 29736 Accepted: 9918 Description In the age of television, not many people attend theater原创 2017-11-30 12:53:55 · 265 阅读 · 0 评论 -
最大流算法模板 挑战程序设计竞赛
const int MAX_V=1e8; struct edge{ int to,cap,rev; }; vector G[MAX_V]; //图的邻接表表示 int level[MAX_V]; //顶点到原点的距离标号 int iter[MAX_V]; //当前弧,在其之前的边已经没有用了 //增加一条从from到to的容量为cap的边 void add转载 2017-08-05 15:51:49 · 959 阅读 · 1 评论 -
Wormholes POJ - 3259 Bellman_Ford 算法
题意: 给出多个farms,及farm之间的路径长度(双向),利用虫洞进行时光旅行(即路径为负),问是否存在负环。 Bell_Ford算法: bool Bell_Ford(int s){ //s为起始地点 memset(dis,INF,sizeof(dis)); bool flag; dis[s]=0; for(int j=1;j<=nodeNum原创 2017-07-28 09:49:51 · 425 阅读 · 0 评论 -
POJ 1062 昂贵的聘礼-条件最短路(SPFA)
昂贵的聘礼 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 51944 Accepted: 15612 Description 年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。原创 2017-12-07 13:07:02 · 251 阅读 · 0 评论