图--网络流
文章平均质量分 77
angel_e
这个作者很懒,什么都没留下…
展开
-
最小费用最大流模板
#include "stdio.h" //poj 2135 最小费用最大流模板 #include "string.h" #include using namespace std; #define N 1005 #define INF 0x3fffffff struct node { int u,v; int w,k; int next; }edge[4*N*10]; //题目中边的原创 2013-11-28 14:13:41 · 715 阅读 · 0 评论 -
nyoj 712 探 寻 宝 藏--最小费用最大流
探 寻 宝 藏 时间限制:1000 ms | 内存限制:65535 KB 难度:5 描述 传说HMH大沙漠中有一个M*N迷宫,里面藏有许多宝物。某天,Dr.Kong找到了迷宫的地图,他发现迷宫内处处有宝物,最珍贵的宝物就藏在右下角,迷宫的进出口在左上角。当然,迷宫中的通路不是平坦的,到处都是陷阱。Dr.Kong决定让他的机器人卡多去探险。 但机器人卡多从左上角走到右下角时,只会向原创 2014-05-19 18:01:10 · 927 阅读 · 0 评论 -
最大流模板
#include "stdio.h" //最大流模板 #include "queue" using namespace std; int n,m; #define N 205 #define INF 0x3fffffff int map[N][N]; int maxf[N]; int route[N]; int MIN(int x,int y){ return x<y?x:y; } in原创 2013-11-27 15:58:15 · 494 阅读 · 0 评论 -
poj 1149 PIGS 最大流
#include "stdio.h" //poj 1149 最大流 #include "string.h" #include "queue" using namespace std; #define N 2250 #define INF 0x3fffffff struct node { int u,v,w; int next; }edge[8*N]; int n,idx; int s转载 2013-12-04 20:40:45 · 547 阅读 · 0 评论 -
poj 1459 最大流
#include "stdio.h" //poj 1459 最大流 #include "string.h" #include "queue" using namespace std; #define N 205 #define INF 0x3fffffff int n; bool mark; int map[N][N],maxf[N],route[N]; int EK(); int BFS(转载 2013-12-04 19:25:13 · 578 阅读 · 0 评论 -
poj 3422
#include "stdio.h" //额,按最小费用最大流的模板来的!poj 3422 #include "string.h" #include "queue" using namespace std; #define N 5005 #define INF 0x3fffffff struct node{ int u,v,w,k; int next; }edge[4*N]; int转载 2013-12-03 19:34:39 · 549 阅读 · 0 评论 -
hdu 2686 最小费用最大流
#include "stdio.h" //hdu 2686 最小费用最大流 #include "string.h" #include "queue" using namespace std; #define N 2005 #define INF 0x3fffffff struct node { int u,v,w,k; int next; }edge[4*N*10]; int n,ans原创 2013-11-29 19:18:25 · 500 阅读 · 0 评论 -
poj 3281 最大流
/* 思路:start=0为起点,1~F中每个点为每份food的编号,F+1~F+n中为每头牛的编号,另外F+n+1~F+n+n中也为每头牛的编号,F+n+n+1~F+n+n+D中每个点为每份drink的编号,F+n+n+D+1为终点; 从start到每份food连边,权值为1,; 输入每头牛可以吃的food时,从这头牛(F+1~F+n)到能吃的food(1~F)连边,权值原创 2013-12-08 10:59:37 · 485 阅读 · 0 评论 -
poj 2195 最小费用最大流
#include "stdio.h" //poj 2195 最小费用最大流 #include "string.h" #include "queue" #include "math.h" using namespace std; #define N 210 #define INF 0x3fffffff struct node{ int u,v,w,k; int next; }edge[4转载 2013-12-08 12:33:52 · 680 阅读 · 0 评论 -
poj2516 最小费用最大流
#include "stdio.h" // 最小费用最大流 poj 2516 #include "string.h" #include "queue" using namespace std; #define N 115 #define INF 1000000000 struct node { int u,v,w,k; int next; }edge[8*N*N]; int store[转载 2013-12-07 13:13:19 · 515 阅读 · 0 评论 -
nyoj 667 碟战 最小割(最大流)
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=677原创 2014-05-23 20:30:55 · 625 阅读 · 0 评论