题目:http://poj.org/problem?id=2049 题意: 有一个迷宫,在迷宫中有墙与门 有m道墙,每一道墙表示为(x,y,d,t)x,y表示墙的起始坐标d为0即向右t个单位,都是墙d为1即向上t个单位,都是墙有n道门,每一道门表示为(x,y,d)x,y表示门的起始坐标d为0即向右一个单位表示门d为1即向上一个单位表示门再给出你起点的位置(f1,f2),并保证这个点的位置不会再墙或者门中,为起点到(0,0)最少要穿过多少条门 代码是根据网上大神的稍微改了一下,就交了 #inclu…
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/u013497151/article/details/29562915 海底总动员.... 这个题開始不会建图,彻底颠覆曾经我对广搜题的想法.想了好久. 忽然想到省赛时HYPO让我做三维BFS来着,一直没做,看到POJ计划这个题.就是三维BFS解题,就做了一下, 对于这个题.. . . 实在不知道说什么好,又坑.又SB,POJ的后台数据和题目描写叙述的全然不一样,看了DIscuss之后開始 修改代码…
Finding Nemo Time Limit: 2000MS   Memory Limit: 30000K Total Submissions: 6952   Accepted: 1584 Description Nemo is a naughty boy. One day he went into the deep sea all by himself. Unfortunately, he became lost and couldn't find his way home. Therefo…
Finding Nemo Time Limit: 2000MS   Memory Limit: 30000K Total Submissions: 8631   Accepted: 2019 Description Nemo is a naughty boy. One day he went into the deep sea all by himself. Unfortunately, he became lost and couldn't find his way home. Therefo…
POJ 2251 题目大意: 给出一三维空间的地牢,要求求出由字符'S'到字符'E'的最短路径,移动方向可以是上,下,左,右,前,后,六个方向,每移动一次就耗费一分钟,要求输出最快的走出时间.不同L层的地图,相同RC坐标处是相连通的.(.可走,#为墙) 解题思路:从起点开始分别往6个方向进行BFS(即入队),并记录步数,直至队为空.若一直找不到,则困住. /* POJ 2251 Dungeon Master --- 三维BFS(用BFS求最短路) */ #include <cstdio> #i…
题目链接:http://poj.org/problem?id=2251 Dungeon Master Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 51402   Accepted: 19261 Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit…
Time Limit: 2000MS   Memory Limit: 30000K Total Submissions: 6988   Accepted: 1600 Description Nemo is a naughty boy. One day he went into the deep sea all by himself. Unfortunately, he became lost and couldn't find his way home. Therefore, he sent a…
Dungeon Master Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 25379   Accepted: 9856 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 filled…
Finding Nemo Time Limit: 2000MS   Memory Limit: 30000K Total Submissions: 8117   Accepted: 1883 Description Nemo is a naughty boy. One day he went into the deep sea all by himself. Unfortunately, he became lost and couldn't find his way home. Therefo…
POJ.2251 Dungeon Master (三维BFS) 题意分析 你被困在一个3D地牢中且继续寻找最短路径逃生.地牢由立方体单位构成,立方体中不定会充满岩石.向上下前后左右移动一个单位需要一分钟.你不能对角线移动并且迷宫四周坚石环绕. 若能逃离,则输出逃离需要的最短时间,否则输出Trapped!. 与二维BFS的差别在于,多了一个上下两层.所以除了先后左右移动,还要有上下移动,对于每个位置,总共有6种移动方式,将6种移动方式种可行的每次塞进队列里面就好了. 依旧还要记录歩数.此题没什么大…