#include #include using namespace std; char map[10][10][10]; int startx,starty,startz,endx,endy,endz; int n; struct node { int x,y,z,step; friend bool operator <(node a,node b) { return a.step>b.step; } }; void bfs(int x1,int y1,int z1,int x2,int y2,int z2) { int k; int move[6][3]={0,0,1,0,0,-1,0,1,0,0,-1,0,1,0,0,-1,0,0}; node now,next; priority_queueq; now.x=x1; now.y=y1; now.z=z1; now.step=0; map[now.x][now.y][now.z]='X'; q.push(now); while(!q.empty()) { next=q.top(); q.pop(); if(next.x==x2&&next.y==y2&&next.z==z2) { printf("%d %d\n",n,next.step); return ; } for(k=0;k<6;k++) { now.x=next.x+move[k][0]; now.y=next.y+move[k][1]; now.z=next.z+move[k][2]; if(now.x>=0&&now.x=0&&now.y=0&&now.z