当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3885:Escape from the Minefield

题目描述
After a failed parachute drop lieutenant Jones nds himself in a precarious situation. Instead of landing at the target coordinates, he and his platoon are trapped in the middle of an enemy minefield!
Fortunately, as a special-ops soldier, lieutenant Jones has come prepared for all situations. Among other things, he carries an accurate map that shows the locations of all the mines in the area. Intelligence brie ngs further suggest that the type of anti-personnel mine used by the enemy has a blast- and detection-radius of 2 meters; if you get any closer, you die.
For the moment Jones' platoon is safe, hiding beneath a bush. To keep things simple they plan to make a run for it while staying in a circular formation (In a circular formation the distance of each soldier to the circle's center is less than the circle's radius. The total area of the circle should be enough to accommodate all soldiers.), starting centered at the bush. In this formation each soldier needs an area of 1 square meter on average. For the sake of morale the entire formation should stay outside the blast-radius of any mines.
Of course, lieutenant Jones wants to escape with as many soldiers as possible. But in order to ensure that no one steps on a mine he may have to leave some men behind to be captured by the enemy.
输入解释
On the first line of the input is a positive integer, the number of test cases. Then for each test case:
A line with a single positive integer n < 105, the number of mines in the minefield.
n lines, each containing two integers, the x and y coordinates (in meters) of each mine relative to Jones' current location. |x|, |y| < 105. No two mines have the exact same coordinates.
输出解释
For each test case:
One line containing a single integer, the maximum number of soldiers that can escape.
输入样例
3
3
2 2
2 -2
-2 -2
8
4 2
4 -1
1 4
-2 4
-4 2
-4 -2
-1 -4
2 -4
7
-10 -1
-4 3
-4 -4
-1 -6
2 4
3 -4
7 0
输出样例
2
0
7

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 BAPC 2009

源链接: POJ-3885

最后修改于 2020-10-29T07:14:32+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000 65536