2398 - I2P(I)2021_Yang_hw3 Scoreboard

Time

2021/10/12 21:00:00 2021/10/19 18:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12880 Let's build a RPG game
13272 Reversing Numbers
13279 Rearrange

12880 - Let's build a RPG game   

Description

"RPG games are fun to play, as a CS student, it must be easy for you to build a RPG game, right?"
Your younger sister asked.
To impress your younger sister and makes her happy, you decide to build a RPG game.

As a starter, you want to build the combat system first.
The combat system is used for stimulate the battle between the player and the enemy.

Both the player and the enemy have 3 properties, HP (Health point), ATK (Attack damage), and DEF (Defence).
When the player attack the enemy, the enemy also attack the player at the same time.
The enemy HP will reduce (Player ATK - Enemy DEF) points, and the the player HP will reduce (Enemy ATK - Player DEF) points.
When one's HP is non-positive, the battle end.

Output the process of the battle system!

ouo.

Input

Input contains 2 lines.

The first line contains 3 integers, P_HP, P_ATK, P_DEF,
represent the player's HP, ATK and DEF respectively.

The second line contains 3 integers, E_HP, E_ATK, E_DEF,
represent the enemy's HP, ATK and DEF respectively.

It's a guarantee that:
1 <= P_HP, E_HP <= 1000,
20 <= P_ATK, E_ATK <= 2000,
0 <= P_DEF, E_DEF < 20.

Output

Output contains several lines.

The first line represent the battle start, output "Battle Start \^_^/". (without quotes)

Start from the second line,
output "The player dealt {} damage to the enemy and the enemy dealt {} damage to the player", (without quotes)
then output "The player has {} HP left and the enemy has {} HP left".
You should replace the {} to the correct number.

Until one's HP is non-positive, output the battle end message "Battle End \^_^/". (without quotes)

Sample Input  Download

Sample Output  Download

Tags




Discuss




13272 - Reversing Numbers   

Description

There're two integers A and B, where B is the reverse number of A.

For example, B is 4321 if A=1234.

Please calculate the sum of A and B.

Input

A is a integer (0 < A < 10^9)

Output

Output A+B

Note that you need to print ‘\n’ at the end of the output.

Sample Input  Download

Sample Output  Download

Tags




Discuss




13279 - Rearrange   

Description

There are N students in line according to the seat number, then M pairs of students exchanged their positions in the sequence.

Can you help the teacher find everyone's position according to the seat number 1 ~ N?

 

For example, N = 4 M = 3, and three exchanges are:

1 2

2 3

3 4

The seat arrangement of students during the exchange process:

1 2 3 4

-> 2 1 3 4

-> 2 3 1 4

-> 2 3 4 1

The final positions of students 1 ~ N are 4 1 2 3

Input

The first line contains two integers N M, the number of students and the number of pairs who exchange positions.

Each of the next M lines contains two integers a b, indicating the seat exchange.

 

for all test case:

1 <= a, b <= N, M <= 1000

Output

The positions of students after exchanges. Note that you need to print ‘\n’ at the end of the output.

Sample Input  Download

Sample Output  Download

Tags




Discuss