2 人解决,7 人已尝试。
3 份提交通过,共有 45 份提交。
9.6 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
Hot Spot is a single player game played on a 4 by 4 game board. The purpose of the game is to move a red robot from its current location on the board to the top left corner. The game board may also contain green and blue robots. Each square of the game board can be occupied by no more than one robot at any time.
A robot may move in one of two ways:
Every jump only changes the positions of the existing robots; robots are never removed from or added to the game board.
A blue robot is never allowed to be adjacent horizontally or vertically to another blue robot or to the red robot.
Given the initial configuration of the game board, determine the minimum number of jumps required to move the red robot into the top left corner.
The input specifies the initial position of the board using four lines, each containing four characters. Each character may be either R, indicating the red robot, B, indicating a blue robot, G, indicating a green robot, or a period (.), indicating an empty square.
Output a single line containing a single integer, the minimum number of jumps required for the red robot to reach the top left square of the game board.
.GR. .... .... ....
1
2 人解决,7 人已尝试。
3 份提交通过,共有 45 份提交。
9.6 EMB 奖励。