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

建议使用的浏览器:

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

3774:Elune’s Arrow

题目描述
In a recent DOTA game, Littlepig picked Priestess of the Moon (also been called as “POM”) and wanted to practice his skills. As you may know, POM is famous for her second skill “Elune’s Arrow”, which allows POM to fire a fast magic arrow to deal large damage to the enemy unit. In fact, POM’s arrow always flies in a straight line and disappear after hitting an enemy unit.

Littlepig’s POM was hiding in the forest and intended to shoot a certain important target on the lane. There were also several other enemy units nearby. POM’s arrow might fly in a wrong direction and miss the target, or even if the arrow flew straight to the target, it still could be blocked by other enemy units and couldn’t reach the target. So given a flying direction, your job is to determine whether Littlepig’s arrow would hit his target.
输入解释
The input contains several test cases, and each test case is given in the following format:
The first line contains an integer n (0 < n <= 5), indicating the number of enemy units in the game.
The second line are two integers (x0,y0) representing the position where POM stands.
The third line gives a vector (dx,dy) describing the flying direction of the arrow.
Then n lines follows, each describing an enemy unit. An enemy unit can be considered as a convex polygon and the polygon is given in the following format in a line:


m x1 y1 x2 y2…xm ym


m is the number of vertices(m <= 10), and (x1,y1)…(xm,ym) are the vertices coordinates of the polygon, given in counter-clockwise order.
The first enemy unit is the POM’s target.

The input ends with a zero in a separate line (n=0). All input numbers are integers that do not exceed 105 in magnitude. It is guaranteed that polygons do not contact or overlap, and the point (x0,y0) isn’t inside (or on) any polygons.
输出解释
For each test case, output “HIT” if the arrow hits its target and “MISS” otherwise, in a separate line.
输入样例
1
0 0
0 1
3 2 0 0 2 0 1
1
0 0
-1 -1
3 2 0 0 2 0 1
0
输出样例
HIT
MISS

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

源链接: POJ-3774

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

共提交 0

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