
图论-二分图判定
文章平均质量分 51
JeraKrs
本人目前就职于百度商业研发部,有需要内推的朋友简历可发我邮箱 jerakrs@qq.com
展开
-
uva 11080 - Place the Guards(二分图染色)
题目链接:uva 11080 - Place the Guards #include #include #include #include using namespace std; const int maxn = 205; int N, M, B, W, C[maxn]; vector G[maxn]; void init () { scanf("%d%d", &N,原创 2015-09-11 20:52:18 · 796 阅读 · 0 评论 -
uva 11396 - Claw Decomposition(二分图判定)
题目链接:uva 11396 - Claw Decomposition #include #include #include #include using namespace std; const int maxn = 305; int N, C[maxn]; vector G[maxn]; bool bipartite(int u) { for (int i = 0;原创 2015-09-07 22:56:23 · 565 阅读 · 0 评论 -
hdu 4606 Occupy Cities(几何+二分+KM)
题目链接:hdu 4606 Occupy Cities解题思路首先预处理出两两点之间的最短距离,然后二分背包容量,用KM判断是否可行。预处理部分,将所有线段的端点加入考虑,枚举两点之间直线,如果与线段相交则不可以移动。然后用floyd处理出点点之间的最短距离。判断部分,因为有P个士兵,所以对于一个距离,可以根据占领顺序处理出有向边,然后用KM处理至少需要多少个士兵。代码#include <cstdi原创 2015-10-26 21:26:17 · 719 阅读 · 0 评论