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

建议使用的浏览器:

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

3883:Penguin Bashing

题目描述
In a well-known online game you play a yeti whose goal it is to hit a cute and cuddly penguin in such a way that it flies as far as possible. The game is set in sunny Antarctica, where the ground is littered with obstacles left by human and robotic expeditions. The most dangerous obstacles are sharp, pointy, metal objects, known as spikes. These spikes are most definitely not safe for penguins and children under three years of age.
Besides the occasional expedition, there have also been many wars in Antarctica. The result is that besides spikes, penguins (and yetis), one is also likely to encounter mines on the Antarctic surface. While they are not good for the health of a penguin, the explosions do improve the distance he will travel.
The best way to get a high score in this game is by guring out the optimal strategy in advance. To be able to do this you need to know the following facts:


The yeti always bats at an integral angle between -90 and +90 degrees, -90° is straight down, 0° is to the right and +90° is straight up.
The penguin gets a total velocity of 25m/s regardless of the angle.
The yeti hits the 3kg penguin at exactly one meter above the ground.
Upon hitting the ground the penguin will slide along the ground, while undergoing friction. This will slow it down by 5m/s for every meter traveled.
Upon hitting a mine the penguin will be flung 2m forward through the air, and also undergo an instant increase in velocity of 4m/s forward.
If the penguin hits a spike, the game ends immediately with a score of -100. Otherwise the score will be the horizontal distance traveled in centimeters, rounded to the nearest integer.
Standard Earth gravity (9.81m/s2) is used and drag is ignored.

输入解释
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 integer n < 105, the number of obstacles.
n lines, each containing:
- A single floating point number xi, the position of the obstacle in meters from the start.
- A string describing the obstacle, either "mine" or "spike".
输出解释
For each test case:
One line containing two integers, the highest possible score, and the angle in degrees at which the yeti needs to hit the penguin to achieve that score. In case of a tie output the lowest angle.
输入样例
3
0
1
64.7 spike
2
63.9 mine
64.7 spike
输出样例
6829 44
6466 34
7022 39

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

题目来源 BAPC 2009

源链接: POJ-3883

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

共提交 0

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