2012年7月25日

hdu 2728 && hdu 3829

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3829http://acm.hdu.edu.cn/showproblem.php?pid=2768思路:以cat_lover和dog_lover把观众分为两个集合。只要两个集合内的人的选择有冲突,这两个顶点连接,边代表矛盾,然后求最大独立集。 最大独立集 = 顶点数 - 最小顶点覆盖数(最大匹配数)View Code #include<set>#include<map>#include<stack>#include<queue>#include<cmath 阅读全文

posted @ 2012-07-25 12:02 aigoruan 阅读(200) 评论(0) 推荐(0)

hdu 1054 Strategic Game

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1054题意:给一棵树,选择最小的点数,覆盖整个图。思路:最小点覆盖=最大二分匹配。View Code #include<set>#include<map>#include<stack>#include<queue>#include<cmath>#include<bitset>#include<string>#include<climits>#include<cstdio>#include<vect 阅读全文

posted @ 2012-07-25 10:36 aigoruan 阅读(148) 评论(0) 推荐(0)

导航