2192 问题 B: Maze

时间限制: 1s 内存限制: 128MB 提交: 49 解决: 4
题目描述

There was a man who was addicted to find the right way of the mazes. One day, by accident, he got a maze. However, because of the superior difficulty, he can't find the right way, so he ask you for help.

Write a program to solve a maze by the shortest route possible.
The maze should be read from the standard input. The first line of input will be the number of lines of input in the maze followed by the number of columns in each line.
Each piece of the maze is defined using a single letter:
-W means this piece is a wall and cannpt be passed through
-C means this piece is a corridor and can be passed through
-S means that this piece is the start location
-E means that this piece is the end location
Each entry on the line is separated by a single space. 

输入
first line you should input two numbers m,n to describe the size of the maze
next m lines you should enter the whole maze.
(m,n<=36)
输出
Output should be the same maze only with the shortest route marked using X's. 
If there is no possible solution to the maze the result should be "There is no solution to this maze"
样例输入
10 11
W W W W W W W W W W W
W S W C C C W C C C W
W C W C W C W C W W W
W C W C W C W C C C W
W C W C W C W W W W W
W C C C W C W C C C W
W C W C W C C C W W W
W C W C W C W C C C W
W C W W W C W W W E W
W W W W W W W W W W W
样例输出
W W W W W W W W W W W
W X W X X X W C C C W
W X W X W X W C W W W
W X W X W X W C C C W
W X W X W X W W W W W
W X X X W X W C C C W
W C W C W X X X W W W
W C W C W C W X X X W
W C W W W C W W W X W
W W W W W W W W W W W
提示
零基础同学可以先学习视频课程,包含C/C++、Python、百练、蓝桥杯辅导、算法数据结构等课程,提供视频讲解以及配套习题,还有老师答疑,点击这里了解课程详情

比赛公告

题号:2191,2192,2193,2194,2195,2196,2197,2198,2199,2200

点击上方导航栏的训练,点击题库,寻找题号即可找到对应题目,比赛结束后,请通过训练->题库->寻找对应题目的方式做题

因为不确定因素太多,就不再安排大家轮流讲题了,大家做不出题可以在测试结束后去题库找对应的题目看题解,希望大家自觉练习,认真练习,考核测试会采取不同与现在测试的方式,两个月后综合测试成绩不达标者会退出实验室,希望大家认真对待