编程介的小学生 2019-04-05 20:55 采纳率: 20.5%
浏览 252

浮点的数字的轨道的一个计算方式,怎么利用C程序的语言的编写来实现的

Problem Description
As Chief Bureaucrat at Missile Command, it has recently come to your attention that the existing performance guidelines do not sufficiently penalize frivolous use of expensive ammunition. Therefore, you must write a new battle summary analysis tool which takes into account excess ammunition consumption during battle.

A battle consists of the following elements:
– Shots. A shot is a circularly explosive countermeasure. A shot has a fixed position and a duration of 2 seconds, during which its radius varies from 0 to 1km and then back to 0 according to the formula:
r = (1 – (t – 1)2)1/2
– The ground, at y = 0.
– Missiles. A missile is a point particle that moves at a constant velocity. If a missile collides with a shot, it is neutralized. If a missile hits the ground before being neutralized, it is considered to have hit its target.
– NOTE 1: If a missile hits a shot, the shot does not disappear – it may hit other missiles
– NOTE 2: Shots of 0 radius cannot hit missiles (e.g. a missile will go through an already expired shot).

Performance is evaluated on a simple point scale. The performance criteria are as follows:
– Every neutralized missile adds 1 point.
– Every missile allowed to hit its target subtracts 5 points.
– Every unnecessary shot subtracts 20 points. The number of unnecessary shots in a battle is the difference between the actual number of shots fired and size of the minimum subset of those shots that would have neutralized the same number of missiles.

Input
Input will be given in the following format (legend follows):
nb
nm
mx my mdx mdy mt
...
ns
sx sy st
...
...

In the following legend, indentation denotes repetition of the indented block a number of times equal to the value of the preceding input item:
nb (0 < nb) – number of battles
nm (0 <= nm <= 20) – number of missiles
mx/my (0.0 < my) – initial missile position (in km)
mdx/mdy – missile velocity (in km/s)
mt (0.0 <= mt) – time since battle start of the missile's entrance (in seconds)
ns (0 <= ns <= 20) – number of shots
sx/sy (1.0 <= sy) – shot position at time of detonation (in km)
st (0.0 <= st) – time since battle start of the shot's detonation (in seconds)

Output
For each battle, output a line containing the score for that battle.

Sample Input
2
2
4.0 8.0 0.0 -1.0 0.0
4.0 8.0 1.0 -1.0 0.0
1
4.0 4.0 3.0
3
4.0 10.0 0.0 -1.0 0.0
5.0 10.0 3.0 -6.0 4.0
13.0 10.0 -3.0 -5.0 4.0
3
4.0 5.0 3.0
7.0 8.0 4.0
9.0 4.0 4.0

Sample Output
-4
-17

  • 写回答

1条回答 默认 最新

  • hsb5156 2019-04-06 03:00
    关注

    建议你去看一下这方面的教学视频,不用在这里提问的!

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog