2013年6月5日
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2531大意:防守队员只能平移,且一次移动一步,问碰到进攻球员的最少移动步数,每个队员的身体有多个格子构成,防守队员最多不超过20格,广搜! 1 //变形广搜 2 #include <stdio.h> 3 #include <iostream> 4 #include <queue> 5 #include <string.h> 6 using namespace std; 7 char map[105][105]; 8 bool vis[105][105]; 9 i 阅读全文
posted @ 2013-06-05 17:15 行者1992 阅读(176) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1372大意:骑士“日”字形移动,从初始点移动到终点所需要的最少步子数,广搜 1 /* 2 结构体加广搜可读性更好 3 用数组单独实现也可以,易出错,可读性也不好 4 数组实现的思路是:每个ans[]元素所走的步子数为 5 扩展出这个点的步子数加1 ans[h++]=ans[t-1]+1; 6 */ 7 8 #include <iostream> 9 #include <stdio.h>10 #include <string.h>11 #include <math.h& 阅读全文
posted @ 2013-06-05 17:05 行者1992 阅读(203) 评论(0) 推荐(0) 编辑