题目地址:http://poj.org/problem?id=3020 输入一个字符矩阵,'*'可行,'o'不可行.因为一个点可以和上下左右四个方向的一个可行点组成一个集合,所以对图进行黑白染色(每个点的值为其横纵坐标之和),然后就可划分为二分图,进行最大匹配.最后最大匹配数加剩下的单个点数量即为所求. #include<cstdio> #include<iostream> #include<string.h> #include<algorithm> #in…
http://poj.org/problem?id=3020 首先注意到,答案的最大值是'*'的个数,也就是相当于我每用一次那个技能,我只套一个'*',是等价的. 所以,每结合一对**,则可以减少一次使用,所以就是找**的最大匹配数目. 对于每一个*,和它的上下左右连接一条边(如果是*才连) 那么,这个图是一个二分图,怎么找到左边集合S,右边集合T呢? 我的做法是染色一次,就可以. 这题应该不能贪心吧. 3 5 ***** o***o o*o*o 其实也可以不分开S.T 跑一发最大匹配,然后匹配…
Antenna Placement DescriptionThe Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most striking reason why they got the job, is their discovery of a new, highly noise resist…
/** 题目:poj3020 Antenna Placement 链接:http://poj.org/problem?id=3020 题意: 给一个由'*'或者'o'组成的n*m大小的图,你可以用一个小圈圈圈住两个相邻的'*',问要圈住所有的'*'最少需要多少个小圈圈.(小圈圈可以相交) 思路: 先尽量圈出能圈两个且不重复圈的'*'.剩下的没有圈的'*'一定需要用一个. 所以构造二分图,求最大匹配,结果:ans = 总的'*'数量-最大匹配数*2 + 最大匹配数 = 总的'*'数量-最大匹配数:…
题目链接:https://vjudge.net/problem/POJ-3020 Antenna Placement Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9995   Accepted: 4939 Description The Global Aerial Research Centre has been allotted the task of building the fifth generation of…
Antenna Placement Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9586   Accepted: 4736 Description The Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most st…
Antenna Placement Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6445   Accepted: 3182 Description The Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most st…
题目传送门 /* 题意:*的点占据后能顺带占据四个方向的一个*,问最少要占据多少个 匈牙利算法:按坐标奇偶性把*分为两个集合,那么除了匹配的其中一方是顺带占据外,其他都要占据 */ #include <cstdio> #include <algorithm> #include <cstring> #include <vector> using namespace std; ; const int INF = 0x3f3f3f3f; ][]; ][]; boo…
http://poj.org/problem?id=3020 Antenna Placement Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7565   Accepted: 3758 Description The Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile ph…
链接: http://poj.org/problem?id=3020 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22010#problem/M Antenna Placement Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5500   Accepted: 2750 Description The Global Aerial Research Centr…