Peg Solitaire is a board game played with pegs: in the classic mode, the board has 33 positions and 32 tokens because the center position is without form. The objective of Peg Solitaire is to remove the pegs but only with horizontal and vertical movements. It is also known as English peg solitaire or Senku. In the reverse modes, initially there is only one piece on the board.
题意:5*9的字符矩阵,'.'表示空地','#'表示障碍,'o'表示棋子. 操作:若一个'o'它相邻4格中某个方向也为'o' 则它可以跳跃相邻的'o'落在其旁边的'.'空地上.并且被跨越的'o'消失. 'o'最多8个. 问最少剩余多少个棋子.并求出此时需要的最少操作次数. 因为'o'最多8个 并且每操作一次减少一个'o' BFS存状态麻烦.用dfs是否能不超时? 平均每个'o'操作的次数为2. 那