2013年5月3日

SRM 578 DIV2 DIV1

摘要: 玩了二十多次,终于杀到了div1,纪念一下1、水题,求最大最小值的问题。2、话说找工作的时候有道类似的题,也是在图上遍历,然后将符合性质的点归为一类,将种类数计为n,且最少有一个,那么就是 2^n - 1种。 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <stack> 8 #include < 阅读全文

posted @ 2013-05-03 11:20 kakamilan 阅读(332) 评论(0) 推荐(0) 编辑

poj 3436 最大流+拆点

摘要: 今天总算明白了最大流中的拆点的含义,因为最大流的中两个点u和v,流量的限制记为cap(u,v),如果一个点u的流量限制为m,那么我们可以把u拆成u1和u2,并且对任意的s,将cap(s,u)换成cap(s,u1),对任意的e,将cap(u,e)换成cap(u1,e),最后将cap(u1,u2)置为m,然后套用最大流的通用算法即可 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 阅读全文

posted @ 2013-05-03 08:45 kakamilan 阅读(215) 评论(0) 推荐(0) 编辑

导航