You are asked to navigate a maze. Initially, you are placed at a certain position (the starting position) in the maze and is asked to try to reach another position (the goal position). Positions in the maze will either be open or blocked with an obstacle. Positions are identified by (x,y) coordinates. There are some rules in this problem:
To make this problem more concrete, we will consider the maze represented by a matrix of characters. A maze includes:
There is an empty line at the end of output.
範例輸入 1
S..####### ##.......# #####.#### #####.#### .#........ #####.#### #####..... .#....#### ###.#..... #########G
範例輸出 1
+++####### ##++++...# #####+#### #####+#### .#...+.... #####+#### #####+.... .#...+#### ###.#+++++ #########+
Pro 專屬功能: 查看這題在歷屆 CPE 出現過幾次 — 升級以解鎖.