
网络流
文章平均质量分 79
不可不戒
这个作者很懒,什么都没留下…
展开
-
hdu1532 Drainage Ditches (Dinic)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1532题解:模版题。#include #include #define INF 0x7fffffff#define MAXN 202struct node{ int to,cap,next;}edge[MAXN<<1];int head[MAXN],lev原创 2013-09-15 18:06:10 · 640 阅读 · 0 评论 -
hdu3549 Flow Problem (Dinic)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3549#include #include #define INF 0x3f3f3f3f#define MAX_VER 20#define MAX_EDGE 2002struct node{ int to,cap,next;}edge[MAX_EDGE];int he原创 2013-09-15 18:56:43 · 587 阅读 · 0 评论 -
hdu4289 Control (ISAP算法)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4289题解:将点权转化为边权,拆点,(i,i+n)之间连边,容量为在城市i的花费,然后就是若u,v之间有路,则连边(u+n,v),(v+n,u).最后就是跑最大流了。常用的两种拆点方式: 1. 对于每个节点id,拆成 id 2.对于每个节点id,拆成原创 2013-10-02 10:44:53 · 582 阅读 · 0 评论 -
hdu4280 Island Transport (最大流ISAP算法)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4280#include #include #define MAXN 100002#define MAXE 400002#define INF 0x3f3f3f3fstruct node{ int from,to,next; int cap;}edge[MAXE];原创 2013-10-01 21:45:34 · 817 阅读 · 0 评论 -
hdu4292 Food (ISAP算法)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4292题解:建一超级源点 汇点, 源点与食物相连边权为其数量,汇点与饮料相连 边权也为其数量 把人分成两个点 之间的边权为1 每个人与之需要的食物和饮料相连 边权为1。#include #include #define INF 0x3f3f3f3f #defin原创 2013-10-02 21:10:51 · 762 阅读 · 0 评论 -
hdu3572 Task Schedule (ISAP算法)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3572题解:0为源点,源点与每个任务连一条边容量为天数pi,每个任务与相应时间点相连边容量为1,汇点dest=N+MAX+1,(其中max为结束时间的最大值,n为任务数),每个时间点与汇点相连,边容量为m(机器数)。判断sum(pi)==maxflow.#include原创 2013-10-03 20:26:49 · 744 阅读 · 0 评论