摘要: 题目链接:http://poj.org/problem?id=1426简单的搜索题,一开始想着用bfs,结果TLE了,看有用dfs写A掉了,就用dfs写,过然AC了。bfs超时的代码: 1 ///2014.4.7 2 ///poj1426 3 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 const int MaxLength = 1000000;11 unsigned long long queue[MaxLength];12 int n;13 14 unsigned long lon... 阅读全文
posted @ 2014-04-07 12:21 basement_boy 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=3278题目是简单的bfs,我却花了好多时间调试 1 ///2014.4.5 2 ///poj3278 3 //16MS 4 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 #define MAXLENGTH 40010012 13 struct node14 {15 int line;16 int deep;17 };18 int N,K;19 node queue[MAXLENGTH];20 bool vis... 阅读全文
posted @ 2014-04-07 00:05 basement_boy 阅读(113) 评论(0) 推荐(0) 编辑