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

建议使用的浏览器:

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

3703:Intuition of Escape

题目描述

One of the mysteries in the world of Faerieland is the lake of M. The lake's name comes from the legendary leader M (whose true name was, unfortunately, not recorded in the history of Faerieland) and it was said that once General M experienced a soul-stirring victory when he was still unknown to public. The official records during the battle at the lake of M about General M's command strategy make M more mysterious—approximately 2/3 of the tactics he made derives from his own intuition! Though some people hold the opinion that M's characteristic is no more than lucky since his enemies made as many mistakes as possible, others believe that M's victory relies on his outstanding estimation of the war situation.

Nowadays people are more interested in General M's unbelievable intuition since a new manuscript recording the whole battle is discovered. The last paragraph described that: "...The success of General M's plan destroyed the balance of the war and our victory can be expected soon. But enemy troops can not be destroyed immediately and they will absolutely assault at dawn. General M selected a route to retreat without any information of enemy troops and amazingly nobody has discovered our actions..." Since it really sounds fantastic, you want to verify whether M is as lucky as rumored.

You have accidentally got a sketch of the force distribution before M's retreat and you decided to confirm if M's successful retreat is possible. The biggest vehicle in M's troop can be described as a circle with radius R and initially its central point is at position (0,0). It can be assumed that if the biggest vehicle is not discovered, the whole troops will not be discovered. Each alert area of enemies can be described as a polygon. Note that two polygons may have a joint area. Since this vehicle has not been discovered by any of the enemies, we can believe that the circle would not intersect with any of the polygons during the movement. Besides, the biggest vehicle have some problems with its turning system so that it can only move at a certain direction (in another word, the route of this vehicle is a radial line with starting point (0,0)). If the vehicle never touches any of the alert area when it moves on the selected radial line, the escape is considered possible. Given the force distribution, you are needed to calculate whether M's escape is possible or there are conflicts between the two records.

输入解释

The first line contains a non-negative integer N, the number of polygons, at most 100.
The second line contains a positive floating number standing for the radius R of the biggest vehicle. It is guaranteed that the initial position of the vehicle will not intersect with any of the alert area.
The next N lines contain several integers each, representing a polygon. The first integer K(3 ≤ K ≤ 50) stands for the number of vertices of this polygon, and rest K pairs of floating numbers (x,y) stand for the positions of the vertices, in counterclockwise order. The coordinate will be in the range of -10000...10000.

输出解释

Output contains exactly one line. Write the word "Survive!" if M's escape is possible or the word "Baffling!" if M cannot select a route satisfy the rules mentioned above.  

输入样例
Sample input 1
1
1
10 1.1 -5 8 -5 10 0 8 5 -8 5 -10 0 -8 -5 -1.1 -5 -3 2 3 2
Sample input 2
1
1
10 0.9 -5 8 -5 10 0 8 5 -8 5 -10 0 -8 -5 -0.9 -5 -3 2 3 2

输出样例
Sample output 1
Survive!
Sample output 2
Baffling!
提示

For sample 1, the escape direction is shown as a red arrow in the picture.
Since the exit in sample 1 becomes narrower, there’s no such escape route for sample 2.

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

源链接: POJ-3703

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

共提交 0

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