#493. BFS - 迷宫最短步数
BFS - 迷宫最短步数
题目描述
同上迷宫定义,求从 (0,0) 到 (n-1,m-1) 的最少步数(每步上下左右),若无法到达输出 -1。
输入输出示例
输入:
3 3
0 0 0
0 1 0
0 0 0
输出:
4
Related
In following contests:
同上迷宫定义,求从 (0,0) 到 (n-1,m-1) 的最少步数(每步上下左右),若无法到达输出 -1。
输入:
3 3
0 0 0
0 1 0
0 0 0
输出:
4
In following contests:
By signing up a Hydro universal account, you can submit code and join discussions in all online judging services provided by us.