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

建议使用的浏览器:

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

2678:TimeLimit

题目描述
Magina is surround by hundreds of monsters. Can he survive in T unit times?
Now matter Magina or monster have three attributes(ATI, DEF, HP), but Magina have another attributes (MaxHP). Magina can own some equipments as a hero , there are six kinds of equipment ("Head", "Weapon", "Armor","Shoes", "Trump","Cuff") in this world. Equipment have three attributes (A, D, MH), each standing the value can increase to ATI, DEF and MaxHP of Magina.
To every some kinds of equipment, Magina can only choose one to use. So when he have some kinds of equipments, he will choose the one have the bigger value. The value of equipments define as A*3 + D*2 + MH. If the value of equipments is equal to the one Magina have, he will not choose to change his equipment.




Now describe a fighting between A and B.
We know A hurt B first, the value of harm define as P.
P = MAX(1,(int)((A's ATI - B's DEF) / ( abs(Xa-Xb) + abs(Ya-Yb) + 1))). (Xa,Ya) and (Xb,Yb) is the position of A and B. So B's HP will reduce P.
Than B hurt A. A will loss MAX(1,(int)((B's ATI - A's DEF) / ( abs(Xa-Xb) + abs(Ya-Yb) + 1))).
Every one will die if his HP is small or equal to 0.

In the 2d-world. Magina standing in the position (0,0) and never moving, in T unit time, n monsters will move nearly to attack he. To every unit time we divide it to four processes.
First Magina choose K monsters to attack once each continuously .(He will attack all if there are no K monsters survived ) If a monster die by attacking, he will drop a equipment. Than Magina can choose weather to use it. The way Magina choose is according to the P which is the value of his hurting to the monster. The first K higher monsters will be selected at the every unit time's begining, if two monsters have some P, the smaller ID of monsters will be selected.
Second every monster survived will hurt Magina once continuously. If Magina die, game over.

Third every monster survived will move to Magina one unit. If the monster is standing the place of Magina, he will not move. One unit is meaning X or Y to change only one.

Fourth Magina will revert W HP. W = (int) ( MaxHP*0.05 ). The maximum of HP can not bigger than MaxHP.
输入解释
The input contains multiple test cases.
First line give the integer n (1<= n <=400)
Next line ATI, DEF, MaxHP,K,T. (T<=100). Magina is HP = MaxHP and have no equipment at the begin.
Next follow n line, each line expressing a monster by increasint ID.The input form as ATI, DEF,HP,X,Y, Kind'smane, A, D, MH. All integer are nonnegative.Last four expressing the equipment this monster owned.Kind'smane is the kind name of equipment.It can only be one of six describing foregoing
输出解释
Output the information of Magina's equipment during the T unit times.
If Magina use a equipment when he have no this kind of equipment, Output “Magina get the Sname”.
If Magina use a new well equipment, output"Magina update the Sname", Sname is the kind name of six equipments.
Last Output "Magina death !" if Magina is death .Otherwise output "Magina killed Num Monster!",Num is a numbers of monsters Magina killed during T unit times.
Every case follow a blank.
输入样例
1
30 2 100 1 3
3 0 10 2 2 Head 1 0 0

5
192 114 29 3 64
22 3 140 15 5 Head 32 18 4
45 15 114 4 11 Trump 34 47 48
44 9 186 19 2 Cuff 28 46 12
32 3 2 10 18 Armor 45 40 15
27 3 104 1 3 Trump 37 2 22

5
30 130 33 2 85
34 4 163 13 15 Head 32 9 15
11 3 8 3 12 Cuff 7 22 4
11 14 143 3 18 Weapon 48 17 35
5 14 27 10 1 Cuff 9 25 41
34 17 135 13 1 Weapon 48 0 33
输出样例
Magina get the Head
Magina killed 1 Monster!

Magina get the Trump
Magina update the Trump
Magina get the Armor
Magina get the Head
Magina get the Cuff
Magina killed 5 Monster!

Magina get the Cuff
Magina death !
来自杭电HDUOJ的附加信息
Author yifenfei
Recommend lcy

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

源链接: HDU-2678

最后修改于 2020-10-25T22:55:49+00:00 由爬虫自动更新

共提交 0

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