题目
200:Solitaire
总时间限制: 5000ms 单个测试点时间限制: 1000ms 内存限制: 65536kB
描述
Solitaire is a game played on a chessboard 8x8. The rows and columns of the chessboard are numbered from 1 to 8, from the top to the bottom and from left to right respectively.
There are four identical pieces on the board. In one move it is allowed to:move a piece to an empty neighboring field (up, down, left or right),jump over one neighboring piece to an empty field (up, down, left or right).

There are 4 moves allowed for each piece in the configuration shown above. As an example let’s consider a piece placed in the row 4, column 4. It can be moved one row up, two rows down, one column left or two columns right.
Write a program that:
reads two chessboard configurations from the standard input,verifies whether the second one is reachable from the first one i

本文介绍了一个编程问题,要求通过广度优先搜索算法(BFS)判断给定的两个8x8棋盘棋子配置,是否可以通过不超过8步的移动从第一个配置转换到第二个配置。程序需要处理四个独立移动的棋子,并考虑边界和重叠情况。
7550

被折叠的 条评论
为什么被折叠?



