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

建议使用的浏览器:

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

6220:Defense of the Ancients

题目描述
In the game of Defense of the Ancients, a team has n units and the other team has m towers. Each unit and towerhas some hit points (HP) and a fixed attack power (AP). The units (resp. towers) with positive HP are surviving and can attack the towers (resp. units), and the units (resp. towers) with zero HP are dead (resp. destroyed) andcannot attack anything.
The game is real-time and the time goes continuously. If a tower (resp. unit) is being attacked by k units (resp.towers) with the AP of $a_1, a_2, ... , a_k$ at the same time, then its HP will continuously decrease with the rate of $a_1 + a_2 + ... + a_k$ per second. There is no restriction on attack ranges. That is, any unit can attack any towers andvice versa.
During the whole game, the surviving units (resp. towers) will attack a selected tower (resp. unit) together untilit has been destroyed (resp. killed). That is, the surviving units (resp. towers) will focus to destroy (resp. kill) the towers (resp. units) one by one.
If all the units are killed and there is at least a surviving tower, the tower team wins. If all the towers are destroyed and there is at least a surviving unit, the unit team wins. If all the units are killed and all the towers are destroyed at the same time, the game ends in a tie.
Both teams play optimally. Your task is to predict the winner of the game.
输入解释
The first line is the number of test cases up to 10.
For each test case, there are 5 lines. The first line contains two integers n and m (0 < n ≤ 10^5, 0 < m ≤ 10^5).
The second line contains n integers, which are the HP of the units. The third line contains n integers, which are the AP of the units. The forth line contains m integers, which are the HP of the towers. The fifth line contains m integers, which are the AP of the towers.
All the HP and AP are positive and less than 2^32.
输出解释
For each test case, if the unit team has a winning strategy, output “Units win”, if the tower team has a winning strategy, output “Towers win”, if the game ends in a tie, output “Tie”.
输入样例
3
1 1
10
10
9
11
2 2
1 1
5 4
2 1
4 2
3 3
1 2 3
1 4 9
1 4 9
1 2 3
输出样例
Units win
Towers win
Tie
来自杭电HDUOJ的附加信息
Recommend jiangzijing2015

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6220

最后修改于 2020-10-25T23:29:25+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 262144/262144K(Java/Others)