
BFS
文章平均质量分 84
J_Sure
唯苦修深思方能顿悟
展开
-
AOJ-AHU-OJ-6 Hero in maze(拓展)
上次在Hero in maze中我把从白书上学到的BFS分享了一下。但是白书上的《走迷宫》其实是输出走出迷宫路径的。如果想要更好地学习BFS。请看如何打印出拯救公主的路径。代码如下:#include #include int q[900], la_dir[30][30], dir[900];//数组q[max*max]作为队列,保存当前位置 ,la_dir数组用于保存最后一次移动的方向原创 2014-03-02 21:14:00 · 1645 阅读 · 0 评论 -
送情报
描述:走迷宫,其中原创 2014-08-05 11:28:35 · 1139 阅读 · 0 评论 -
POJ-2935 Basic Wall Maze
Basic Wall MazeTime Limit: 1000MS Memory Limit: 65536K Special JudgeDescriptionIn this problem you have to solve a very simple maze consisting of: a 6 by原创 2014-08-05 10:20:29 · 761 阅读 · 0 评论 -
Snakes and Ladders
描述蛇和梯子游戏是一个非常流行的游戏。原创 2014-08-03 11:01:23 · 1174 阅读 · 0 评论 -
POJ-3026 Borg Maze
Borg MazeTime Limit: 1000MS Memory Limit: 65536KDescriptionThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collec原创 2014-08-09 23:39:30 · 982 阅读 · 0 评论 -
HDU-1548 A strange lift
A strange liftTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionThere is a strange lift.The lift can stop can at every floor as you want原创 2014-09-13 11:14:51 · 740 阅读 · 0 评论 -
八数码问题(bfs+哈希)
白书上给出了灰常飘逸原创 2014-04-16 15:28:57 · 4820 阅读 · 0 评论 -
【BFS|位运算】POJ-1753 Flip Game
Flip GameTime Limit: 1000MS Memory Limit: 65536K DescriptionFlip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 square原创 2014-11-09 22:07:51 · 892 阅读 · 0 评论 -
【BFS|位运算+输出路径】POJ-2965 The Pilots Brothers' refrigerator
The Pilots Brothers' refrigeratorTime Limit: 1000MS Memory Limit: 65536K Special JudgeDescriptionThe game “The Pilots Brothers: following the stripy elep原创 2014-11-12 09:55:34 · 802 阅读 · 0 评论 -
HDU-2612 Find a way
Find a wayTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3725 Accepted Submission(s): 1212Problem DescriptionPass a year learnin原创 2014-08-07 10:29:15 · 844 阅读 · 0 评论 -
POJ-1324 Holedox Moving
Holedox MovingTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 13366 Accepted: 3171DescriptionDuring winter, the most hungry and severe time, Holedox sleep原创 2014-08-04 14:17:42 · 954 阅读 · 0 评论 -
POJ-1915 Knight Moves
Knight MovesTime Limit: 1000MS Memory Limit: 30000K DescriptionBackgroundMr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knig原创 2014-08-04 16:25:38 · 904 阅读 · 0 评论 -
HDU-OJ-1429 胜利大逃亡(续)
胜利大逃亡(续)Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionIgnatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)……这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安原创 2014-03-11 22:37:05 · 1039 阅读 · 0 评论 -
HDU-OJ-1253 胜利大逃亡
胜利大逃亡Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B原创 2014-03-11 22:17:03 · 1172 阅读 · 0 评论 -
AOJ-AHU-OJ-664 彩灯高高挂
彩灯高高挂Time Limit: 1000 ms Case Time Limit: 1000 ms Memory Limit: 64 MBDescriptionBran收到了好友的一个礼物——彩灯。彩灯是一个n×n×n的正方体,由n×n×n个小正方体组成,每个小正方体都是一个小彩灯。我们用坐标(x,y,z)(0≤x,y,z<n)来表示各个小彩灯,那么有彩原创 2014-03-28 16:51:02 · 1328 阅读 · 0 评论 -
AOJ-AHU-OJ-579 期末考试之考试传纸条
期末考试之考试传纸条Time Limit: 1000 ms Case Time Limit: 1000 ms Memory Limit: 32 MBDescription平时不努力,考试得着急呐。传说中的BT监考老师竟然搬来了信号屏蔽工具,手机不管用啦有木有。不过这难不到大家,cxlove见证了同学们使用传统的作弊方式----传纸条,纸条得从A同学传到B同学处,在一个N原创 2014-03-10 11:11:21 · 1095 阅读 · 0 评论 -
搜索的优化算法——剪枝
原文地址http://princetonboy.ycool.com/post.2805302.html【摘要】本文讨论了搜索算法中“剪枝”这一常见的优化技巧.首先由回溯法解决迷宫问题展开论述,介绍了什么是剪枝;而后分析剪枝的三个原则正确、准确、高效,并分别就剪枝的两种思路:可行性剪枝及最优性剪枝,结合例题作进一步的阐述;最后对剪枝优化方法进行了一些总结.在竞赛中,我们有时会碰到一些转载 2014-03-18 21:21:14 · 2807 阅读 · 0 评论 -
POJ-1077 Eight
EightTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 23270 Accepted: 10269 Special JudgeDescriptionThe 15-puzzle has been around for over 100 years;原创 2014-04-16 19:16:37 · 1099 阅读 · 0 评论 -
USACO-cha1-sec1.4 The Clocks
The ClocksIOI'94 - Day 2Consider nine clocks arranged in a 3x3 array thusly:|-------| |-------| |-------| | | | | | | | |---O | |---O | | O |原创 2014-07-03 22:40:05 · 1141 阅读 · 3 评论 -
HDU-1242 Rescue
RescueTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16004 Accepted Submission(s): 5813Problem DescriptionAngel was caught by th原创 2014-08-01 15:39:23 · 938 阅读 · 0 评论 -
POJ-1465 Multiple
MultipleTime Limit: 1000MS Memory Limit: 32768K Descriptiona program that, given a natural number N between 0 and 4999 (inclusively), and M distinct decimal digits原创 2014-08-03 18:51:33 · 996 阅读 · 0 评论 -
AOJ-AHU-OJ-6 Hero in Maze
Hero In MazeTime Limit: 1000 ms Case Time Limit: 1000 ms Memory Limit: 64 MBDescription500年前,Jesse是我国最卓越的剑客。他英俊潇洒,而且机智过人^_^。突然有一天,Jesse心爱的公主被魔王困在了一个巨大的迷宫中。Jesse听说这个消息已经是两天以后了,他知道公主在迷原创 2014-02-27 19:24:30 · 2203 阅读 · 0 评论