编程介的小学生 2017-02-13 15:10 采纳率: 20.5%
浏览 828
已采纳

Sacred Warrior

问题描述 :

Sacred Warrior is a hero in DotA and his name is Huskar. The Sacred Warrior’s abilities revolve around shortening his own lifespan to spear his foes to burinng pieces.When we control the Sacred Warrior , we always want to give our enemies the most damage.So to simplify the problem,let’s consider the Sacred Warrior’s two skills as below:

(1) Burning Spear

When the Sacred Warrior use the Burning Spear to attack his enemy, follow things will happen in order in the current second:

1.the enemy gets physical hurt by a normal attatk.

2.if the enemy’s burning degree BD is greater than zero,the enemy will gets BD*FI damage points.(at the beginning,the enemy’s burning degree is zero).

3.the enemy’s burning degree +1.

4.the remanent burning time become 6.

5.the Sacred Warrior’s HP decrease by D. The Sacred Warrior can not kill himself(don’t ask me why),that is,when the Sacred Warrior’s HP is less than or equal to D, the Sacred Warrior can not use Burning Spear!

When the Sacred Warrior use a single normal attack instead of Burning Spear, follow things will happen in order in the current second:

1.the enemy gets physical hurt by the normal attack.

2.if the enemy’s burning degree BD is greater than zero,the enemy will gets BD*FI damage points.(at the beginning,the enemy’s burning degree is zero).

3.the remanent burning time decrease by 1.

4.if the remanent burning time is zero, then the enemy’s burning degree become zero.

(2) Berserk’s blood

The Sacred Warrior’s base attack is A.

Whenever the Sacred Warrior’HP reduce R ,his attack will increase U, it means the Sacred Warrior will get ((HS-HC) / R)*U extra attack.(round down for division, hs is the original HP and the hc is the current HP).

The normal attack NA is the sum of base attack and extra attack.

The enemy has a defence degree DEFi and it change every second(the reason is complicated,such as Weave,Meld,Gush,Natural Order,Mekansm and so on).Whenever the enemy is attacked by a normal attack(a single normal attack or the first part of Burning Spear), if the enemy’s defence degree is greater than the normal attack, the enemy won’t get any physical hurt(but the burning effect is still effective), otherwise the enemy will get NA-DEFi damage.(NA is the current normal attack and the DEFi is the current defence degree).

Every second The Sacred Warrior can choose using a single normal attack or Burning Spear to attack the enemy. But in order to make the most damage and lose too much HP is obviously not wise. So we use a evaluation function F=C – (HS-HE)*P to evaluate the fight. (hs is the original HP and the he is the HP after last second, C is the total damage he cause).Can you find the maximal F ?

输入:

The first line contains a single positive integer N( N <= 20 ), indicates the number of test cases.

For each test case:

The first line contains eight integers T , HS , A , R , U , D , FI , P , T is the total time in seconds and the others is as described above.

The second line contains T integers , the i-th integer is the defence degree DEFi in i-th second.

0< T < 200 , 0< HS < 100 , 0 < A < 5000 , 0< R < HS , 3<= D <= 10 , 0 <= U , FI , P <1000

0 <= DEFi <3000

输出:

The first line contains a single positive integer N( N <= 20 ), indicates the number of test cases.

For each test case:

The first line contains eight integers T , HS , A , R , U , D , FI , P , T is the total time in seconds and the others is as described above.

The second line contains T integers , the i-th integer is the defence degree DEFi in i-th second.

0< T < 200 , 0< HS < 100 , 0 < A < 5000 , 0< R < HS , 3<= D <= 10 , 0 <= U , FI , P <1000

0 <= DEFi <3000

样例输入:

2
5 10 5 3 2 3 2 1
0 0 0 0 0
5 10 1 7 1 3 5 1
2 2 2 2 2
样例输出:

Case #1: 52
Case #2: 36

  • 写回答

1条回答 默认 最新

  • devmiao 2017-02-13 18:28
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持