当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6101:Gumballs&Dungeons

题目描述
Warriors Gumball goes to a maze which has N * M cells.
There are seven monsters in this maze, numbered from 0 to 6. Each monster has HP and ATK.

There are 4 types of buff in the maze:
1. ATK buff : increase Ab attack point (ATK)
2. DEF buff : increase Db defense point (DEF)
3. HP buff : increase Hb health point (HP)
4. MP buff : increase Mb magic point (MP)

Warriors Gumball is a great Gumball. At first he has As ATK, Ds DEF, Hs HP and Ms MP. And he can use 3 types of magic:
1. Drainage of magic : increase Hm HP
2. Light spells : increase Am ATK
3. Earth magic : increase Dm DEF
Each magic which Warriors used will consume Mm MP.

The meaning of the symbols in the maze:
'S' : initial position of Warriors Gumball, ‘S’ only appear once.
'#' : obstacle, can't move to this cell
'.' : empty, can move to this cell
'A' : ATK buff
'D' : DEF buff
'H' : HP buff
'M' : MP buff
'0' - '6' : denotes monster. This cell can be moved in only if this monster is killed.Each number only appear once.

Each step Warriors Gumball can move in four directions(up, down, left, right).

If Warriors Gumball want to kill a monster, he will attack monster.
In every attack, If Warriors Gumball's DEF not less than monster’s ATK, He will not get hurt. Otherwise Warriors Gumball's HP will reduce the value equivalent to the difference between monster's ATK and Warriors Gumball's DEF. monster's HP will reduce the value equivalent to Gumball's ATK. Warriors Gumball’s HP and monster’s HP will reduce at the same time.
If the monster's HP reduced to less than or equal to 0, the monster will die.
But if Warriors Gumball's HP reduced to less than or equal to 0, he will die and game over.

He wants to know the maximum HP can be remained when he kill all monsters(When all the monsters are killed, you can still explore the maze). Can you help him?
输入解释
The first line is an integer T which indicates the case number.
And as for each case, first line is two integer N and M which indicates the size of maze.
Next N line, each line M character which indicates the maze.
Next seven line, each line is two integer A and H, which indicates the monsters ATK and HP
Next line is four integer As, Ds, Hs, Ms which indicates Warriors Gumball initial state
Next line is four integer Am, Dm, Hm, Mm which indicates information of magic
Next line is four integer Ab, Db, Hb, Mb which indicates information of buff

Limit
$1 \leq T \leq 20$
$1 \leq N, M \leq 100$
$1 \leq Ai, Hi \leq 20$
$1 \leq As, Ds, Hs, Ms \leq 100000$
$1 \leq Am, Dm, Hm, Mm \leq 100000$
$1 \leq Ab, Db, Hb, Mb \leq 100000$
输出解释
As for each case, you need to output one integer which indicate the answer.
If Warriors Gumball can’t achieve goal, output -1.
输入样例
2
4 4
S012
###M
###4
H365
2 2
2 2
18 2
2 2
2 2
2 2
2 2
1 1 20 1
1 1 1 1
1 1 10 1
4 4
S012
###M
###4
H365
2 2
2 2
2 2
19 2
2 2
2 2
2 2
1 1 20 1
1 1 1 1
1 1 10 1
输出样例
11
13
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6101

最后修改于 2020-10-25T23:28:22+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/65536K(Java/Others)