Curling 2.0(深搜)

在MM-21星球上,一种独特的冰壶游戏正在流行。玩家需要将唯一的冰壶从起点移动到目标,最少步数到达为胜。游戏遵循特定规则,包括直行移动,遇到障碍物会停止等。此问题可通过深度优先搜索算法解决,找出从起点到目标的最短路径。输入数据描述了游戏板的配置,输出是最小移动步数或失败情况下的-1。
摘要由CSDN通过智能技术生成
Curling 2.0
Time Limit: 1000MS   Memory Limit: 65536K
Total Submissions: 19063   Accepted: 7807

Description

On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an ice game board on which a square mesh is marked. They use only a single stone. The purpose of the game is to lead the stone from the start to the goal with the minimum number of moves.

Fig. 1 shows an example of a game board. Some squares may be occupied with blocks. There are two special squares namely the start and the goal, which are not occupied with blocks. (These two squares are distinct.) Once the stone begins to move, it will proceed until it hits a block. In order to bring the stone to the goal, you may have to stop the stone by hitting it against a block, and throw again.


Fig. 1: Example of board (S: start, G: goal)

The movement of the stone obeys the following rules:

  • At the beginning, the stone stands still at the start square.
  • The movements of the stone are restri
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值