摘要:
http://poj.org/problem?id=3984简单bfs#define MAXN 5int n, m;int Q[MAXN*MAXN];bool vis[MAXN][MAXN];bool maze[MAXN][MAXN];int dx[4] = {-1, 0, 1, 0};int dy[4] = {0, 1, 0, -1};int dir[MAXN*MAXN];int lastDir[MAXN][MAXN];int fa[MAXN][MAXN];//int dist[MAXN][MAXN];void BFS(int x, int y);void PrintPath(int x, 阅读全文