题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1054 求最小覆盖点,也就是求最大匹配,要用邻接表写,不然会TLE:当然也可以用HK算法: #include<stdio.h> #include<string.h> #include<queue> #include<algorithm> using namespace std; #define N 1510 int vis[N], head[N], cnt, us…
Strategic Game Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5034    Accepted Submission(s): 2297 Problem Description Bob enjoys playing computer games, especially strategic games, but somet…
Strategic Game Problem Description Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must defend a medieval city, the roa…
题目链接:https://vjudge.net/problem/HDU-1054 Strategic Game Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8673    Accepted Submission(s): 4174 Problem Description Bob enjoys playing computer gam…
Strategic Game Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must defend a medieval city, the roads of which form a t…
Strategic Game Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10153    Accepted Submission(s): 4744 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1054 Description: Bob enjoys playing compute…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1054 思路:树形DP,用二分匹配也能解决 定义dp[root][1],表示以root 为根结点的子树且在root放一个士兵的最优值,那么因为在root已经有士兵了,所以对其孩子来说可以放也可以不放 那么dp[root][1]+=min(dp[son][1],dp[son][0]); dp[root][0]表示以root为根结点的子树且在root没有放士兵的最优值,那么因为在root没有士兵,所以在其…
题意: 一个r*c的矩形,求一个子矩形通过平移复制能覆盖整个矩形 关于一个字符串的最小覆盖子串可以看这里http://blog.csdn.net/fjsd155/article/details/6866991 把他分成对行和对列,对行覆盖最小就是n - next[n] ,然后求最小公倍数 对列的也是n - next[n], 然后求最小公倍数 #include <iostream> #include <cstdio> #include <algorithm> #inclu…
参考博客:如何找取 最小覆盖点集合 题意:R*C大小的网格,网格上面放了一些目标.可以再网格外发射子弹,子弹会沿着垂直或者水平方向飞行,并且打掉飞行路径上的所有目标,计算最小多少子弹,各从哪些位置发射,才能将所有的目标全部打掉 分析:就是求最小覆盖点 以及 输出所有的覆盖点 最小覆盖点 == 最大匹配数 个人理解: 最大匹配数是用匈牙利算法求的,就是从左边一个点开始找到他看上的那个妹纸,如果那个妹纸已经名花有有主就跟那个男生换一个...沿着 ( 没匹配 - 匹配边 -... - 没匹配边)  这…
B - Strategic Game Time Limit:10000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1054 Description Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast…