Problem Statement | |||||||||||||
题目简述: 在一个2D平面上,有一些飞船沿着各自的有向线段以各自的速度移动。它们同时出现在起点,一旦到达终点就消失。 一个飞船可以在攻击在它的射程范围内death star。 一个飞船在同一时间可以攻击多个death star。若攻击X个death star,需要消耗X点能量。 每个飞船有各自的初始能量值,如果能量不足则无法攻击。 同一时刻一个death star只能被一个飞船攻击,且它被攻击后不会消失,在下一时刻它依然能被攻击。 输入每个death star的坐标,和飞船的起点坐标、终点坐标、速度、射程、初始能量。 求所有飞船消耗能量总和的最大值。 数据范围: death star个数不超过20个 飞船个数不超过20个 Princess Elly recently discovered secret plans for building a whole bunch of new death stars. Now she and the rebels are desperately trying to destroy them before they are fully operational. They are sending several ships to destroy the death stars. For simplicity, in this problem the battle will take place in a 2D plane. The distances are so large that we will view all death stars and all ships as points in this plane. All death stars are stationary. All ships appear at their starting positions at the same time. Each ship is a point moving at some constant speed along some line segment, however the speeds for different ships may be different. As soon as a ship reaches the end of its segment, it disappears from the battlefield. (This does not necessarily happen at the same time for all the ships.) The rebels know the locations of all death stars. Also, for each ship they know its planned trajectory, its speed, the range of its lasers, and the amount of energy available for shooting them. A ship can shoot at a death star if:
| |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Limits | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | Your return value must have a relative or an absolute error of less than 1e-9. | ||||||||||||
- | The range of a ship's lasers is given in distance units (the same ones as all coordinates). | ||||||||||||
- | The speed of a ship is given in distance units per second. | ||||||||||||
- | A ship can have the same starting and ending point. Such ship disappears immediately after appearing on the battlefield. | ||||||||||||
- | Multiple death stars can be located at the exact same place. They are still considered to be distinct death stars. | ||||||||||||
- | Multiple ships can be located at the exact same place at some moment of time. A ship and a death star can be located at the exact same place at some moment of time. In both cases, no collision happens and each ship just proceeds moving along its defined trajectory. | ||||||||||||
Constraints | |||||||||||||
- | stars will contain between 1 and 20 elements, inclusive. | ||||||||||||
- | Each element of stars will contain between 3 and 9 characters, inclusive. | ||||||||||||
- | Each element of stars will be formated as "X Y" - two space-separated integers between 1 and 1000, inclusive. | ||||||||||||
- | ships will contain between 1 and 20 elements, inclusive. | ||||||||||||
- | Each element of ships will contain between 13 and 34 characters, inclusive. | ||||||||||||
- | Each element of ships will be formated as "SX SY EX EY S R E" - seven space-separated integers between 1 and 1000, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.