POJ 4127: 迷宮問題 BFS

代碼很簡單,學會使用BFS能夠很快解決此類問題 #include #include const int maxn = 65536; int c[4][2] = {0,1,1,0,0,-1,-1,0}; int visit[5][5]; int m[5][5]; int pre[maxn]; int q[maxn][2]; int bfs() { int head = 0;
相關文章
相關標籤/搜索