POJ 3009-Curling 2.0(DFS)】的更多相关文章

Curling 2.0 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11879   Accepted: 5028 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…
http://poj.org/problem?id=3009 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. The…
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…
http://poj.org/problem?id=3009 如果目前起点紧挨着终点,可以直接向终点滚(终点不算障碍) #include <cstdio> #include <cstring> using namespace std; ; int maz[maxn][maxn]; int n,m; ] = {,-,,}; ] = {,,,-}; bool in(int x,int y) { && x < n && y >= &&a…
题目链接. 分析: 本题BFS A不了. 00100 00001 01020 00000 00010 00010 00010 00010 00030 对于这样的数据,本来应当是 5 步,但bfs却 4 步.具体原因可以仔细看一下上面的样例. 应当dfs穷举所有的可能,找出最短的. #include <iostream> #include <cstdio> #include <queue> using namespace std; ; <<); , -, ,…
原题 $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…
-->Curling 2.0 直接上中文 Descriptions: 今年的奥运会之后,在行星mm-21上冰壶越来越受欢迎.但是规则和我们的有点不同.这个游戏是在一个冰游戏板上玩的,上面有一个正方形网格.他们只用一块石头.游戏的目的是让石子从起点到终点,并且移动的次数最小 图1显示了一个游戏板的例子.一些正方形格子可能被砖块占据.有两个特殊的格子,起始点和目标点,这是不占用块.(这两个方块是不同的)一旦石头开始移动就不会停下,除非它击中砖块块.为了使石头到达终点,你可以通过让石块击中墙壁或者砖块…
POJ 3009 题意: 给出一个w*h的地图,其中0代表空地,1代表障碍物,2代表起点,3代表终点,每次行动可以走多个方格,每次只能向附近一格不是障碍物的方向行动,直到碰到障碍物才停下来,此时障碍物也会随之消失,如果行动时超出方格的界限或行动次数超过了10则会game over .如果行动时经过3则会win,记下此时行动次数(不是行动的方格数),求最小的行动次数 #include<cstdio> #include<iostream> #include<cstring>…
Curling 2.0 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 12158   Accepted: 5125 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…
Curling 2.0 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 14563   Accepted: 6080 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…