今天AC了杭电OJ的1253题《胜利大逃亡》,题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1253 该题目是一个比较经典立方体迷宫问题,要求在给定的时间内从始点(0,0,0)逃到出口(a-1,b-1,c-1),这里我采用的是BFS(宽度优先搜索)。 代码如下:#include<iostream>using namespace std;int map[55][55][55],a,b,c,times,visit[55][55][55];int fx[6]={1,-1,0,0,0,0},fy[6]={0,0,1,-1,0,0},fz[6] Read More
posted @ 2013-05-27 15:51 paradise in hell Views(193) Comments(0) Diggs(0) Edit