创想实验室
我们都是梦想家

Go! Pokemon Master

描述

Although Sono is twenty years old, he still has a child’s heart and wants to become a Pok? emon master.
Fortunately, Sono got his own Pok? emon on his twentieth birthday and is on his way to becoming a
Pok? emon master. Now, Sono has just met his ?rst opponent. As he is still not very skilled in battle, he
asks you to help him determine whether he can win the battle.
Each Pok? emon has eight attributes: HP (hit points), Physical Attack, Physical Defense, Magical Attack,
Magical Defense, Speed, Element Type and Attack Type (which is either Physical or Magical). The rules
of the battle are as follows:
1. The battle is turn-based. In each turn both sides will attack once, the Pok? emon with a higher Speed
attacks ?rst. If the Speed of the two Pok? emons are the same, Sono’s Pok? emon will attack ?rst.
2. If a Pok? emon’s Attack Type is Physical, the Base Damage it will do will be equal to its Physical
Attack minus the opponent’s Physical Defense.
3. If a Pok? emon’s Attack Type is Magical, the Base Damage it will do will be equal to its Magical
Attack minus the opponent’s Magical Defense.
4. As is mentioned above, each Pok? emon has an Element Type, which is either Water, Fire or Grass.
Each Element Type is weak to another: Fire is weak to Water, Grass is weak to Fire and Water is
weak to Grass. Base on the Element Type of the two Pok? emons, the Real Damage is calculated as
follows:
• If the attacking Pok? emon’s Element Type is weak to its opponent’s, then the Real Damage it
will do will be equal to (Base Damage)/2, rounded down.
• If the opponent’s Element Type is weak to the attacking Pok? emon’s, then the Real Damage
will be equal to (Base Damage) ∗ 2.
• If neither of the above two cases is true (which means the two Pok? emons has the same Element
Type), then the Real Damage will be equal to Base Damage.
5. If the Base Damage is less than 1, then Rule 4 does not apply and the Real Damage will be equal
to 1.
6. If after applying Rule 4 the Real Damage is less than 1 then the the Real Damage will be equal to
1.
7. The opponent’s HP will decrease by the Real Damage. If after the attack the opponent’s HP is less
than or equal to 0, the battle ends immediately and the attacking Pok? emon wins.

输入

The first line of the input contains a single integer T (1 ≤ T ≤ 1000), the number of test cases. T test
cases follow.
The first line of each test case contains eight integers, denoting Sono’s Pok? emon’s HP, Physical Attack,
Physical Defense, Magical Attack, Magical Defense, Speed, Element Type and Attack Type respectively.
The second line contains the opponent’s Pok? emon’s attributes in the same format.
The values of HP, Physical Attack, Physical Defense, Magical Attack, Magical Defense and Speed will be
between 1 and 255 inclusive.
Element Type will be equal to either 0,1, or 2, where 0 denotes Water, 1 denotes Fire and 2 denotes
Grass.
Attack Type will be equal to either 0 or 1, where 0 denotes Physical and 1 denotes Magical.

输出

For each test case output in a single line ?WIN? (without quotes) if Sono can win, otherwise output
?LOSE? (without quotes).

样例输入

样例输出

题解

一题纯模拟题目,死在英语上了啊。。。。

代码

 

网站所发布的代码已提交通过,代码可能经过修改防止抄袭,未经允许不得转载:创想实验室 » Go! Pokemon Master
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址