Shirlies
宁静专注认真的程序媛~
摘要: 广搜要记录方格里面不同状态时行走的步数注意当当前行走的步数大于记录的步数时要剪枝(当然,在记录方格不同状态时的值不为-1时)代码如下: 1 #include <iostream> 2 #include <cstring> 3 #include <queue> 4 using namespace std; 5 6 struct node 7 { 8 int x,y; 9 int step; 10 int state; 11 }; 12 char map[105][105]; 13 int R,C; 14 int sx,sy; 15 int used[1... 阅读全文
posted @ 2012-08-05 00:01 Shirlies 阅读(225) 评论(0) 推荐(0) 编辑