HDU 2295 Radar(DLX可重復覆蓋)
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 with a radius of R. Our goal is to
minimize R while covering the entire city with no more than K radars.
Input
The input consists of several test cases. The first line of the input consists of an integer T, indicating the number of test cases. The first line of each test case consists of 3 integers: N, M, K, representing the number of cities, the number of radar stations
and the number of operators. Each of the following N lines consists of the coordinate of a city.
Each of the last M lines consists of the coordinate of a radar station.
All coordinates are separated by one space.
Technical Specification
1. 1 ≤ T ≤ 20
2. 1 ≤ N, M ≤ 50
3. 1 ≤ K ≤ M
4. 0 ≤ X, Y ≤ 1000
Output
For each test case, output the radius on a single line, rounded to six fractional digits.
Sample Input
1
3 3 2
3 4
3 1
5 4
1 1
2 2
3 3
Sample Output
2.236068
Source
The 4th Baidu Cup final
題意:n個城市,m個雷達站,最多用k個雷達站,問你每個雷達站的覆蓋半徑最少
為多少。DLX可重復覆蓋做法:我們可以考慮以m個雷達站為N,以n個城市為M做成
DLX的可重復覆蓋模型。那麼N*M的bool值有如何確定了,我們考慮二分半徑r,對
於每次二分的半徑r,我們在根據距離求出bool矩陣的0和1,然後就是DLX的可重復
覆蓋模型。值得注意由於最多不超過k個雷達站,也是重要剪枝。
#include
#include
#include
#include
#include
#include
#include
#include
#include