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

建议使用的浏览器:

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

3935:Striking Ball

题目描述
Little Tom loves playing games. One day he downloads a computer game called 'Striking Ball', which makes him very excited. The game field is a rectangular window, and there are many rectangular bricks of the same size in it. A ‘striking ball’ is bouncing in that window. Every brick is placed parallel to the window’s bottom line. At the beginning of the game, little Tom may put the ball at any position on the bottom line of the window and launch it in any direction upwards. Then the striking ball will change its direction only when it hits the bricks or the border of the window. The ball changes its direction according to the light reflection rule. A brick will disappear immediately when hit by the ball. Every striking at the brick brings little Tom the amount of points which the brick owns. Once the striking ball touches the bottom line, the game ends.
Given the launching position and direction of the striking ball, little Tom wants to know how many points in total he will get during the game.
You may ignore the volume of the ball and just regard it as a point.
This is a picture showing that a ball is launched from coordinate X on the bottom line of the window, and the launch angle is α.

输入解释
Input contains multiple test cases. Each test case means one game. It starts with five numbers: W, H, w, h, n(0<W, H<=1000, 0<w<W, 0<h<H, n<=500) which stands for the width and height of the window, the width and height of the bricks and the number of bricks in the window.(The input ends by a line with five zeros) The next n lines shows the information of n bricks in the following format: xi, yi, pi(0<=xi<=W-w, 0<=yi<=H-h, 0<pi<=100). The first two float numbers stand for the coordinate of the lower left corner of the brick and the last integer stands for the points the brick owns. The last line contains two float number X, α(0<=X<=W, 0<α<180), which stands for the launch X-coordinate and launch angle (in degrees) of the striking ball.

It guarantees that
At any time, the distances between the ball and any corners of the bricks are always larger than 0.000001. Also, the distances between the ball and the window corners are always larger than 0.000001.
输出解释
For each test cases output one line with the total points that little Tom will get.
输入样例
3 3 2 1 1
0.5 1 100
0 42
5 5 0.7 1 6
0.4 2.5 1
1.1 2.5 2
1.8 2.5 4
2.5 2.5 8
3.2 2.5 16
3.9 2.5 32
2.55 45
0 0 0 0 0
输出样例
100
38

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

源链接: POJ-3935

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

共提交 0

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