Introduction - If you have any usage issues, please Google them yourself
Present a lattice maze, the labyrinth consists of a grid of N rows and N columns. There are three maze grid, the first one is a wall, you can not pass the second grid normal passage through the lattice can be reached with its adjacent up/down/left/right grid and the third grid in addition to a first two grid functions, it also has " teleport" feature, this lattice arrive, you can choose whether a given moment is transferred to the lattice. In the maze of a grid consisting of the three, given a start and end location, find the minimum cost required the beginning of the end arrives. The figure is a 3* 3 grid maze, the maze has a grid on the 2nd of " teleport" feature is capable of transmitting to the 8th grid, the grid is capable of transmitting the 7th to the 9th grid. Labyrinth Example 3* 3 1 0 (8)-1 2 1 2 0 (9) 1 2 Input Description First line: the value of the starting point of the maze lattice size N number start end end The next grid numbers N* N lines: followe