
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 1e9using namespace std;const int MAX_V=500;struc原创 2017-08-05 16:23:10 · 306 阅读 · 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 · 351 阅读 · 0 评论 -
POJ - 2240 Arbitrage Floyd
ArbitrageTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 24944 Accepted: 10568DescriptionArbitrage is the use of discrepancies in currency exchange rate原创 2017-11-23 20:49:20 · 242 阅读 · 0 评论 -
POJ - 3660 Cow Contest
Cow ContestTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 13409 Accepted: 7465DescriptionN (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are part原创 2017-11-23 19:58:30 · 264 阅读 · 0 评论 -
POJ - 1502 MPI Maelstrom
MPI MaelstromTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 10524 Accepted: 6466DescriptionBIT has recently taken delivery of their new supercomputer,原创 2017-11-23 19:31:01 · 214 阅读 · 0 评论 -
POJ 2195 Going Home 最小费用流
Going HomeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 23975 Accepted: 12034DescriptionOn a grid map there are n little men and n houses. In each uni原创 2017-12-03 21:07:10 · 264 阅读 · 0 评论 -
POJ 2516 Minimum Cost k次最小费用流
Minimum CostTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 17611 Accepted: 6191DescriptionDearboy, a goods victualer, now comes to a big problem, and h原创 2017-12-09 17:42:12 · 345 阅读 · 0 评论 -
POJ 3159 Candies 差分约束-SPFA栈实现
CandiesTime Limit: 1500MS Memory Limit: 131072KTotal Submissions: 33931 Accepted: 9528DescriptionDuring the kindergarten days, flymouse was the monitor of his c原创 2017-11-30 20:38:27 · 271 阅读 · 0 评论 -
POJ 1151 -Invitation Cards- SPFA
Invitation CardsTime Limit: 8000MS Memory Limit: 262144KTotal Submissions: 29736 Accepted: 9918DescriptionIn the age of television, not many people attend theater原创 2017-11-30 12:53:55 · 254 阅读 · 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 · 941 阅读 · 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 · 412 阅读 · 0 评论 -
POJ 1062 昂贵的聘礼-条件最短路(SPFA)
昂贵的聘礼Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 51944 Accepted: 15612Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。原创 2017-12-07 13:07:02 · 241 阅读 · 0 评论