AM 789. The Maze III
需要多一个状态矩阵表示 方向 Code ( Language :C++) ( Judger :cloudjudge-cluster-9) Edit class Solution { public : /** * @param maze: the maze * @param ball: the ball position * @param hole: the hole position * @return: the lexicographically smallest way */ struct node { int x, y; node( int x, int y){ this ->x = x; this ->y = y; } }; const vector < int > dx = { -1 , 1 , 0 , 0 }; const vector < int > dy = { 0 , 0 , -1 , 1 }; const string movs = "udlr" ; //错误 把这里写错了,debug了半小时,简直不能忍!!!! const int dir = 4 ; bool canStop ( int x, int y, vector < vector < int >> &maze) { if (x < 0 || y < 0 || x >= maze.size() || y >= maze[ 0 ].size() || maze[x][y] == 1 ){ return true ; } return false ; } string findShortestWay ( vector < vector < int >...