题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1253
//这个题我MLE了好几次,就意识到剪枝的必要性
//改进后的代码
#include <iostream>
#include <queue>
using namespace std;
int dir[6][3] = {{0,0,1},{0,1,0},{0,0,-1},{0,-1,0},{1,0,0},{-1,0,0}};
bool Map[50][50][50];//保存地图
struct Pos {
int x, y, z, t;
};
int main()
{
int k, a, b, c, time, wall;
int x, y, z, i, j, p;
bool flag;
queue<Pos> q;
Pos v, temp;
scanf("%d", &k);
while(k--) {
flag = false;
wall =......
阅读全文