
杭电搜索
xueerfei
wu
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
杭电 Prime Ring Problem 1016 DFS
http://acm.hdu.edu.cn/showproblem.php?pid=1016 趁老板没有召见之前,再水几个题 直接深搜: #include #include #include #include using namespace std; int n; setse; int num[21]; bool vis[21]; void print() { for(int i=1;i原创 2013-08-18 16:07:21 · 1282 阅读 · 0 评论 -
杭电 1043 Eight (A*搜索)
http://acm.hdu.edu.cn/showproblem.php?pid=1043 看了一晚的A*,早上的时候终于可以看懂这些个代码了。 其中的康托展开被用来做哈希,一开始还不怎么明白啥玩意叫康托,百科了一下,基本了解个大概。 A*的确在迷宫搜索方面厉害,下面这几个博客是学习参考的,推荐一下【突然想到了,谷歌百度的地图搜索是不是也用的A* 呢?】: http://www.cnbl原创 2013-08-19 16:06:02 · 2337 阅读 · 2 评论 -
杭电 1044,1072
其实后来想了一下,这两个题其实是一样的,只不过1044需要剪枝,并且随时需要在结束的时候更新总的值,而且在到达终点的时候不能退出。 1044 代码,看有人用状态压缩,用了900ms,我在队列push之前多添加一个剪枝,就是看当前到终点的距离时候超过了要求的时间,可以降到800ms #include #include #include #include #define maxn 51 u原创 2013-08-21 11:34:35 · 1650 阅读 · 0 评论 -
杭电 1245
推箱子: http://acm.hdu.edu.cn/showproblem.php?pid=1254 bfs+dfs 记不清是哪个题来着,用的类似的方法,用广搜确定两点之间的距离,然后用深搜搜答案。应该是1044这道题吧。 少加了一个剪枝,然后各种超时 #include #include #include using namespace std; bool原创 2013-08-22 21:40:36 · 1112 阅读 · 0 评论 -
杭电 1430
魔板问题: http://acm.hdu.edu.cn/showproblem.php?pid=1430 复习一下康托展开哈希,再次学习一下amb的代码。非常好理解 大神的代码看起来就是美 #include #include #include #include #include #include using namespace std; char smaze[10],t原创 2013-08-23 15:32:59 · 1542 阅读 · 0 评论 -
杭电 1732 Push Box
经典的推箱子。。 写的真好。。 开始还没看明白,抄了一遍懂了。 #include #include #include using namespace std; bool map[10][10][5]; int d[4][2]={-1,0,0,-1,1,0,0,1}; char maze[10][10],b[10][10]; int tx,ty,px,py; struct point { i原创 2013-08-24 19:12:48 · 1245 阅读 · 1 评论 -
杭电 Tempter of the Bone 1010
学习了另一种剪枝发:奇偶剪枝 http://blog.youkuaiyun.com/piaoyi0208/article/details/7721192转载 2013-08-18 15:35:01 · 969 阅读 · 0 评论