Submit | All submissions | Best solutions | Back to list |
Problem hidden on 2012-06-16 10:32:45 by :D
HEROADV - Hero Adventure |
There is a game production company that is going to develop a new adventure game. You’re very interested and join the recruitment phase. You’re being tested to solve this simulation:
For each simulation there will be an R x C map with the following characters:
o '#' represents wall, hero can't move here.
o 'S' represents starting point of the hero.
o 'F' represents finish point, the game ends.
o Number '1' to '9' represents the life point to be reduced if the hero moves here.
o 'E' represents enemy that the hero need to fight if the hero want to move here.
o 'I' represents item that will add 100 points to the hero's life force, become '0' after taken (no life force will be reduce to come back to this point).
The hero has life force (Lf), Experience (Exp), Defend power (Def) and Strength (Str).
The hero will be given extra 1 (one) point for the strength and defend power for each 25 (twenty five) experience point gained by the hero.
Hero will die if Lf ≤ 0.
Rules of the fight with enemy:
o Each enemy will have Strength, Life force and Experience.
o The hero and the enemy will be given one chance to attack the other each turn start with the hero, until either the hero or the enemy die (life force ≤ 0).
o If the hero attacks the enemy, the enemy's life force will be decreased by the hero's strength.
o If the enemy attacks the hero, the hero's life force will be decreased by the enemy's strength reduced by the hero's defend power.
o The hero will be given the enemy's experience if the hero defeats the enemy.
o After the enemy defeated, the place will become '0' (no life force will be reduce to come back to this point).
For each simulation, you’re asked to print three paths, Lf and Exp to the finish point that give:
1. The highest Lf.
2. The highest Exp. If there’s more than one highest Exp, choose the highest Lf.
3. The shortest way. If there’s more than one shortest way, choose the highest Lf.
If there is multiple path, choose the lexicographically smallest one.
Input
Input consists of several cases.
Each case begins with four integers in a line: Str (3 ≤ Str ≤ 10), Def (0 ≤ Def ≤ 5), Exp (0 ≤ Exp ≤ 20) and Lf (10 ≤ Lf ≤ 1000).
Denoting the strength, defend, experience and life force of the hero respectively.
The next line contains C (3 ≤ C ≤ 20) and R (3 ≤ R ≤ 20) denoting the columns and rows of the map respectively.
The next R lines contain the map as described above.
The next lines contain the description of the enemy, eStr (0 ≤ eStr ≤10), eLf (10 ≤ eLf ≤ 100) and eExp (1 ≤ eExp ≤ 25) denoting the enemy’s strength, life force and experience to be gained if it dies respectively.
Each enemy data corresponds to each ‘e’ which appear first in the map.
Output
For each simulation print "Simulation #n" without double quote(") and #n replace by the simulation number start with 1.
The next three lines each contain path, life force and experience. Use ‘L’ (left), ‘R’ (right), ‘D’ (down), ‘U’ (up) to describe the path that should be taken by the hero.
If it’s not possible to reach the finish point then print "No solution." without double quote (“) instead of the three lines.
Print blank line between simulation.
Sample Input
10 5 20 1000
3 3
### SEF ###
10 50 15
10 0 0 100
7 4
#######
S12E#2#
#IE456F
#######
3 10 5
10 100 20
10 0 0 10
3 3
###
SEF
###
10 50 15
Output for Sample Input
Simulation 1
RR 980 35
RR 980 35
RR 980 35
Simulation 2
RDURRDRRR 181 5
RDRRUDRRR 90 25
RDRRRRR 94 20
Simulation 3
No solution.
Added by: | VOJ problem setters |
Date: | 2009-10-28 |
Time limit: | 5s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 C++ 4.3.2 NODEJS OBJC PERL6 SQLITE VB.NET |
Resource: | ACM ICPC - Jakarta 2009 |
hide comments
2010-10-22 06:12:30 Zorc
Yes, there are some unresolved issues, I'd like to give this problem a try, once I make sure the input and output are 100% right, the input is relatively small, so I'm not sure if the time limit will be a problem, I solved something similar to this before, using a simple modification on BFS |
|
2010-10-15 06:26:07 :D
Maybe this problem should be hidden/removed? I found this yesterday: http://www.suhendry.net/blog/?p=957&page=9 So there are some unresolved issues here. Plus I found no indication anywhere that this problem ever been solved. Even if you somehow work out those issues, the time limit could turn out to be tight. |
|
2010-10-14 16:21:11 Zorc
Shouldn't the output of simulation 2 be : Simulation 2 RDURRDRRR 181 5 RDRURDRRR 92 25 RDRRRRR 94 20 |
|
2010-03-26 20:10:29 Wolfram
What happens if you move back onto 'S'? |