2013年7月30日
摘要: 题目链接。分析:本题BFS A不了。001000000101020000000001000010000100001000030对于这样的数据,本来应当是 5 步,但bfs却 4 步。具体原因可以仔细看一下上面的样例。应当dfs穷举所有的可能,找出最短的。#include #include #include using namespace std;const int maxn = 23;const int INF = (1= 10) return ; for(int d=0; d= h || ny >= w) continue ; if(G[nx][ny] == 1) con... 阅读全文
posted @ 2013-07-30 18:53 Still_Raining 阅读(853) 评论(0) 推荐(0) 编辑