Dungeon Master poj 2251 dfs】的更多相关文章

Language: Default Dungeon Master Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 16855   Accepted: 6564 Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or…
Dungeon Master Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 48605   Accepted: 18339 Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be fille…
链接: http://poj.org/problem?id=2251 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 21370   Accepted: 8299 Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may…
对于3维的,可以用结构体来储存,详细见下列代码. 样例可以过,不过能不能ac还不知道,疑似poj炸了, #include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; const int INF = 0x3f3f3f3f; int dx[] = {1, -1, 0, 0, 0, 0}; int dy[] = {0, 0, -1, 1, 0,…
You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south, east, west, up or down. You cannot move diagonal…
//纯bfs #include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <queue> using namespace std; ; char g[maxn][maxn][maxn]; bool vis[maxn][maxn][maxn]; ][] = { { , , }, { -, , }, { , , }, { , -, },…
题目链接:https://vjudge.net/problem/POJ-2251 题意:简单的三维地图 思路:直接上代码... #include <iostream> #include <string.h> #include<queue> #include <algorithm> using namespace std; #define rep(i,j,k) for(int i = (j); i <= (k); i++) #define per(i,j…
http://poj.org/problem?id=2251 Dungeon Master Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18773   Accepted: 7285 Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes…
POJ 2251 题目大意: 给出一三维空间的地牢,要求求出由字符'S'到字符'E'的最短路径,移动方向可以是上,下,左,右,前,后,六个方向,每移动一次就耗费一分钟,要求输出最快的走出时间.不同L层的地图,相同RC坐标处是相连通的.(.可走,#为墙) 解题思路:从起点开始分别往6个方向进行BFS(即入队),并记录步数,直至队为空.若一直找不到,则困住. /* POJ 2251 Dungeon Master --- 三维BFS(用BFS求最短路) */ #include <cstdio> #i…
p.MsoNormal { margin-bottom: 10.0000pt; font-family: Tahoma; font-size: 11.0000pt } h1 { margin-top: 5.0000pt; margin-bottom: 5.0000pt; text-align: left; font-family: 宋体; font-weight: bold; font-size: 24.0000pt } span.10 { font-family: "Times New Rom…