题目请戳这里 题目大意:一个城市n个点,现在要建m个消防站,消防站建在给定的n个点中.求建m个消防站后,m个消防站要覆盖所有的n个点的覆盖半径最小. 题目分析:重复覆盖问题,DLX解决.不过要求覆盖半径最小,需要二分.虽然给的范围并不大,DLX毕竟还是暴力搜索,而且精度有6位小数,因此直接二分距离的话会TLE!解决方案是将图中任意2点的距离记录下来,去重后二分已知的距离.因为消防站建在给定的n个点中,那么最小覆盖半径一定在任意2点距离中产生. DLX搜索的时候,一般习惯删除的时候从左往右,不过效…
题目大意: 有一堆雷达工作站,安放至多k个人在这些工作站中,找到一个最小的雷达监控半径可以使k个工作人所在的雷达工作站覆盖所有城市 二分半径的答案,每次利用dlx的重复覆盖来判断这个答案是否正确 #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <queue> #include <climits> #includ…
Description N cities of the Java Kingdom need to be covered by radars for being in a state of war. Since the kingdom has M radar stations but only K operators, we can at most operate K radars. All radars have the same circular coverage with a radius…
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=2295 题意::一个国家有n个城市,有m个地方可以建造雷达,最多可以建K个雷达(K>=1 && K<=m),问雷达最短的探测半径,才能使n个城市都能探测到. 分析:二分距离,然后再DLX重复覆盖来判断.n个城市排成n列,再将每个城市当成一行,在二分的距离内能到达的城市在该列标为1,然后问题就转换成选至多k行来覆盖所有列,并且是可重复覆盖. #include <cstdio>…
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=5046 题意:要在n个城市里建造不超过k个机场覆盖所有城市,问机场城市之间最大距离最小为多少. 分析:二分距离+DLX判断,n个城市n列,然后n行,每行城市i在二分的距离内能到达列j就标为1,问题转化为选不超过k行来覆盖所有列(可重复覆盖). 注意:最大距离为4*1e9,爆int了,要用long long,不然会TLE... #include <cstdio> #include <cstrin…
Radar Problem Description N cities of the Java Kingdom need to be covered by radars for being in a state of war. Since the kingdom has M radar stations but only K operators, we can at most operate K radars. All radars have the same circular coverage…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5046 题意: 给定n个城市的坐标,要在城市中建k个飞机场,使城市距离最近的飞机场的最长距离最小,求这个最小距离. 分析: 最小化最大值,显然二分最大距离.然后我们将距离在范围内的两个城市建边,看能否选出k个城市,使得覆盖了所有城市. 将点之间的关系转化成01矩阵的覆盖问题,重复覆盖,建好边套个DLX即可. 看了鸟神博客,这里可以直接将所有距离保存在一个数组中,排序并去重,二分下标即可.这样快了很多…
这一道题和HDU2295是一样 是一个dancing links重复覆盖解决最小支配集的问题 在给定长度下求一个最小支配集,只要小于k就行 然后就是二分答案,每次求最小支配集 只不过HDU2295是浮点,这里是整数 我写的一个比较暴力 #include<cstdio> #include<cstring> #include<queue> #include<cstdlib> #include<algorithm> #include<vector…
2分答案+DLX判断可行 不使用的估计函数的可重复覆盖的搜索树将十分庞大 #include <iostream> #include <cstring> #include <cstdio> #include <cmath> #include <vector> using namespace std; #define FOR(i,A,s) for(int i = A[s]; i != s; i = A[i]) #define exp 1e-8 , M…
Description As we know,the fzu AekdyCoin is famous of math,especially in the field of number theory.So,many people call him "the descendant of Chen Jingrun",which brings him a good reputation.  AekdyCoin also plays an important role in the ACM_D…