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

建议使用的浏览器:

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

3099:Defense of the Ancients

Special Judge 特殊评判
题目描述
DotA? I’m afraid you’ve got a wrong impression, because we are talking about some real Ancients.
A lot of towers are in the first quadrant of rectangular coordinates. And between every two towers there is a wall. All of them are Ancients. Somehow, some skytroopers are trying to attack our Ancients and all we know is that they’ll land at the second, third and fourth quadrant of rectangular coordinates. Because those areas are desolation, the troops decided to follow a fixed straight line. Now we’ve got all the landing coordinates of the troops and the polar angle of their walking lines. To protect our Ancients, we need to know where the troops will first arrive at the Ancients.

输入解释
There are multiple test cases.
First line contains a single integer T (T<=10), indicates the number of test cases.
For each test case:
The first line has two positive integers N and M (1<N<=100000, M<=100000), represent the number of towers and skytroopers.
Following N lines, each line contains two integers X and Y, represents the coordinate of the tower.
Following M lines, each line has three integers SX, SY and XITA, indicates the coordinates of a skytrooper and the polar angle of their attacking line (in degrees). SX and SY will not bigger than 0 at the same time.
All the coordinates values lies in [-20000, 20000]. No two towers will be in same place.
输出解释
For every skytrooper, output one line, if the trooper can reach the Ancients, output the coordinate he will first arrive, otherwise output “safe”.
If the value differs in 0.01 with our standard output, we’ll consider it as accepted.
输入样例
1
6 3
5 1
8 5
13 2
14 7
7 9
1 7
-2 -2 45
8 -2 90
-3 7 120
输出样例
3.400000 3.400000
8.000000 1.375000
safe
来自杭电HDUOJ的附加信息
Recommend chenrui

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3099

最后修改于 2020-10-25T23:00:00+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)