![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
网络流
sunny606
这个作者很懒,什么都没留下…
展开
-
USACO 4.2 Drainage Ditches
这是一道网络流的模板题,只要知道网络流的基本概念应该就能水过,在此只贴代码,有空我会写一篇网络流入门的文章供还没有接触过网络流的朋友阅读。 代码: #include #include #include #define MAX 210 #define oo 10000001 using namespace std; int map[MAX][MAX],arcs,nodes,_max,layer原创 2012-04-18 21:10:34 · 811 阅读 · 1 评论 -
USACO 4.2 The Perfect Stall网络流解最大二分图匹配
如下图所示方式构图,每条边的容量为1,则从source到sink最大流量就等于cow与stall的最大匹配 代码: #include #include #define MAX 410 using namespace std; FILE *in,*out; int map[MAX][MAX],nodes,ans,layer[MAX]; bool table[MAX]; void fl原创 2012-04-19 16:10:27 · 1501 阅读 · 0 评论