|
#14 JUMPING PAWNS
There is a 1x20 board and 10 pawns are placed on the leftmost squares. Your task is to move these 10 pawns to the rightmost squares in minimum steps.
A step consists of either a MOVE or a JUMP
-MOVE: Pawn can move to the empty adjacent square to its right.
-JUMP:Pawn can jump over adjacent right pawn to the next square if it is empty. Jumping must continue till the pawn can't jump.
What is te minimum number of steps to accomplish this task?
If the probem was asked for 1x6 board and 3 pawns, then the answer would be 5:
![]()
有一个1X20棋盘,10个卒子方在最左边的方格中。你的任务是用最少的步骤将这些10卒走到最右边的方格中。
一个步骤或者是移动,或者是跳跃。
移动:卒子可以移动到其右侧的相邻空位。
跳跃:卒子可以越过相邻的卒子跳到下一个方格,如果这个位子是空位的话。跳跃必须持续,直到跳不动。
完成此任务的最少步骤是几步?
如果问的是1X6棋盘和3个卒子,那么答案将是5:
0:PPP***
1:PP*P**
2:*P*PP*
3:**PPP*
4:**P*PP
5:***PPP
|
|