编程介的小学生 2017-10-31 01:29 采纳率: 20.5%
浏览 789
已采纳

God of War

Problem Description
At 184~280 A.D ,there were many kingdoms in China. Three strongest among them are "Wei", "Shu", "Wu". People call this period as "Three Kingdoms".
HH is a super "Three Kingdoms" fan, because at this period there were many heroes and exciting stories. Among the heroes HH worships LvBu most.
LvBu is the God of War and is also intelligent, but his ambition is too big while enemies are too powerful .Many monarchs wanted to kill him.
At 198 A.D ,CaoCao fought with LvBu at Xuzhou.Though Lvbu is the God of War ,CaoCao had so many generals: Xuchu,DianWei XiahouChun……Facing so many heroes ,could LvBu beat all of them?

Given the LvBu's ATI, DEF, HP, and enemies’ ATI, DEF,HP, experience (if LvBu killed one of his enemies, he can get that experience ,and if his experience got more than or equal to 100*level,he would level-up and become stronger) and the In_ATI,In_DEF,In_HP(indicating when LvBu levels up,his ability will increase this point).
Each turn LvBu will choose an enemy to fight. Please help LvBu find a way to beat all of enemies and survive with the max HP.
Here’s a fight between LvBu and A:
If LvBu attack A, A will lose Max(1,LvBu's ATI- A's DEF) hp;
If A survived, he will give LvBu Max(1,A'ATI- LvBu'DEF) injury.
If LvBu is still alive, repeat it untill someone is dead(hp <= 0).
LvBu's initial level is 1 and experience is 0,and he can level up many times.

Input
The input contains at most 20 test cases.
For each case , the first line contains six intergers ,indicating LvBu's ATI,DEF,HP and In_ATI,In_DEF,In_HP.
The next line gives an interger N(0<N<=20),indicating the number of the enemies .
Then N lines followed, every line contains the name(the length of each name is no more than 20),ATI,DEF,HP, experience(1<experience<=100).

Output
If LvBu is dead output "Poor LvBu,his period was gone."
Or output the maximum HP left.

Sample Input
100 80 100 5 5 5
2
ZhangFei 95 75 100 100
XuChu 90 90 100 90

100 75 100 5 5 5
1
GuanYu 95 85 100 100

Sample Output
30
Poor LvBu,his period was gone.

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-11-23 02:29
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Matlab怎么求解含参的二重积分?
  • ¥15 苹果手机突然连不上wifi了?
  • ¥15 cgictest.cgi文件无法访问
  • ¥20 删除和修改功能无法调用
  • ¥15 kafka topic 所有分副本数修改
  • ¥15 小程序中fit格式等运动数据文件怎样实现可视化?(包含心率信息))
  • ¥15 如何利用mmdetection3d中的get_flops.py文件计算fcos3d方法的flops?
  • ¥40 串口调试助手打开串口后,keil5的代码就停止了
  • ¥15 电脑最近经常蓝屏,求大家看看哪的问题
  • ¥60 高价有偿求java辅导。工程量较大,价格你定,联系确定辅导后将采纳你的答案。希望能给出完整详细代码,并能解释回答我关于代码的疑问疑问,代码要求如下,联系我会发文档