编程介的小学生 2017-11-13 06:29 采纳率: 20.5%
浏览 602
已结题

Worms

Problem Description
Worms is a series of turn-based computer games. Players control a small platoon of earthworms across a deformable landscape, battling other computer- or player-controlled teams. The game feature bright and humorous cartoon-style animation and a varied arsenal of bizarre weapons.

During the course of the game, players take turns selecting one of their worms. They then use whatever tools and weapons available to attack and kill the opponents’ worms. Over fifty weapons and tools may be available each time a game is played, and differing selections of weapons and tools can be saved into a “scheme” for easy selection in future games.

When most weapons are used, they cause explosions that deform the terrain, creating circular cavities. If a worm is hit by a weapon, the amount of damage dealt to the worm will be removed from the worm’s initial amount of health. When a worm fall into the water or its health is reduced to zero, it dies.

In this problem, the terrain of a stone can be described as a simple polygon. The worms only use the time bombs. Once a time bomb is thrown, it is only attracted by the force of gravity. In other words, the flying track of the bomb is a parabola. When it reaches the stone (the polygon), the bomb does not blow off or stop immediately. It will still fly along the parabola regardless of the resistance of the stone due to its special character. The time bomb can only be triggered by the timer. When the preset time is used up, the bomb blows up and eliminates all the materials within its explosion range. You need to calculate the area of the eliminated materials of one explosion.

Input
There are multiple test cases.
The first line of a test case contains seven floating numbers x0, y0, v0, θ, t, g, R. (x0, y0) is the position of the worm who throws the bomb, which could be inside the polygon or outside the polygon (even in the sky or under the water). The initial value of velocity is v0 which forms aθ (0≤θ<90) angle with the positive direction of x-axis. The bomb is always thrown upwards. The preset time is t, which is also the time of flying. The value of acceleration of gravity of the worms’ planet is g. The direction of gravity is the negative direction of y-axis. The explosion range is a circle and R is the radius.

The second line contains an integer n (3≤n≤100), which indicates the number of edges of the stone(simple polygon). The following n lines contain two real numbers xi and yi each, which describe the coordinates of a vertex. Two vertexes in adjacent lines are adjacent on the polygon.

The input contains multiple test cases. It is ended by “0 0 0 0 0 0 0”.

Output
For each test case, output one line containing the area of the eliminated materials of the explosion rounded to two digits to the right of the decimal point.

Sample Input
0 0 15 45 10 2 10
3
100 0
200 0
100 100
0 0 0 0 0 0 0

Sample Output
228.74

  • 写回答

1条回答 默认 最新

  • woshihuangzhicai 2018-08-28 11:30
    关注

    0 0 15 45 10 2 10
    3
    100 0
    200 0
    100 100
    0 0 0 0 0 0 0
    Sample Output
    228.74
    这个没错

    评论

报告相同问题?

悬赏问题

  • ¥15 怎么把多于硬盘空间放到根目录下
  • ¥15 Matlab问题解答有两个问题
  • ¥50 Oracle Kubernetes服务器集群主节点无法访问,工作节点可以访问
  • ¥15 LCD12864中文显示
  • ¥15 在使用CH341SER.EXE时不小心把所有驱动文件删除了怎么解决
  • ¥15 gsoap生成onvif框架
  • ¥15 有关sql server business intellige安装,包括SSDT、SSMS。
  • ¥15 stm32的can接口不能收发数据
  • ¥15 目标检测算法移植到arm开发板
  • ¥15 利用JD51设计温度报警系统