早教吧 育儿知识 作业答案 考试题库 百科 知识分享

英语翻译IgnatiusandthePrincessITimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):4030AcceptedSubmission(s):1247SpecialJudgeProblemDescriptionThePrincesshasbeenabductedbytheBEelzebubf

题目详情
英语翻译
Ignatius and the Princess I
Time Limit:2000/1000 MS (Java/Others) Memory Limit:65536/32768 K (Java/Others)
Total Submission(s):4030 Accepted Submission(s):1247
Special Judge
Problem Description
The Princess has been abducted by the BEelzebub feng5166,our hero Ignatius has to rescue our pretty Princess.Now he gets into feng5166's castle.The castle is a large labyrinth.To make the problem simply,we assume the labyrinth is a N*M two-dimensional array which left-top corner is (0,0) and right-bottom corner is (N-1,M-1).Ignatius enters at (0,0),and the door to feng5166's room is at (N-1,M-1),that is our target.There are some monsters in the castle,if Ignatius meet them,he has to kill them.Here is some rules:
1.Ignatius can only move in four directions(up,down,left,right),one step per second.A step is defined as follow:if current position is (x,y),after a step,Ignatius can only stand on (x-1,y),(x+1,y),(x,y-1) or (x,y+1).
2.The array is marked with some characters and numbers.We define them like this:
.:The place where Ignatius can walk on.
X :The place is a trap,Ignatius should not walk on it.
n :Here is a monster with n HP(1
▼优质解答
答案和解析
伊格和公主我
时间限制:2000/1000 MS(JAVA /其他)内存限制:三万二千七百六十八分之六万五千五百三十六K(Java /其他的)
共有意见书(S):4030接受提交的意见书(S):1247
特别法官
问题描述
魔王feng5166被绑架的公主,我们的英雄伊格拯救我们的漂亮的公主.现在,他进入feng5166的城堡.该城堡是一个大迷宫.为了使问题简单地说,我们假设迷宫是一个N * M个二维数组的左上角为(0,0),右下角是(N - 1 M - 1).伊格在(0,0)进入,并feng5166的房间门是(N - 1 M - 1),这是我们的目标.在城堡有一些怪物,如果伊格满足他们,他要杀死他们.下面是一些规则:
1.Ignatius只能在四个方向移动(上,下,左,右),每秒的一个步骤.一个步骤是定义如下:如果当前的位置是(X,Y),一步后,伊格只能站在(X - 1,Y)(X +1,Y),(X,Y - 1)或(X,Y +1).
2,数组是标有一些字符和数字.我们可以这样定义它们:
.:伊格可以步行.
X:这个地方是一个陷阱,伊格不应该走就可以了.
N:这是一个具有n个HP的怪物(1