
Network Flow
文章平均质量分 71
huangshenno1
这个作者很懒,什么都没留下…
展开
-
POJ2226 Muddy Fields
这是个最大匹配的经典题,个人推荐做一做,对建模的理解会更深刻。 总的来说,就是以每个横向的连续污点构成一个X点,以每个纵向的连续污点构成一个Y点,若横向与纵向同时覆盖了一个点,则连接XY。 构图完毕,然后用匈牙利算法。 #include #include const int maxr = 60; const int maxn = 1000; int un,vn,r,c; char原创 2013-03-14 11:39:22 · 478 阅读 · 0 评论 -
ZOJ2587 Unique Attack
题意为判断最小割的唯一性。 求最大流之后,考虑残量网络,从源点和汇点出发分别遍历,最后如果还有没被遍历到的点,则最小割不唯一。 #include #include #include #include #include using namespace std; struct Edge { int from, to, cap, flow; Edge(int ff,int tt,原创 2013-03-14 11:31:26 · 544 阅读 · 0 评论