随笔分类 -  a) 广搜BFS

摘要:链接:http://acm.xidian.edu.cn/contest.php?cid=1028问题 C: 大大数星星时间限制: 1 Sec 内存限制: 128 MB提交: 1928 解决: 655[提交][状态][讨论版]题目描述喜欢数星星真是个传染病,这一天大大和大嫂晚上走在路上抬头看到很多... 阅读全文
posted @ 2017-04-23 19:09 Lawliet__zmz 阅读(236) 评论(0) 推荐(0) 编辑
摘要:L2-006. 树的遍历 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 时间限制 400 ms 时间限制 400 ms 内存限制 65536 kB 内存限制 65536 kB 代码长度限制 8000 B 代码长度限制 8000 阅读全文
posted @ 2017-03-24 00:22 Lawliet__zmz 阅读(142) 评论(0) 推荐(0) 编辑
摘要:传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1242 一般的bfs只能求出的最解,优解通常是步数最少的,但在此题中不一定是时间最少的解,如下图,步数依次是8,8,8,12,时间是13,13,14,12,反而第四种是要求解,一看此题就是用bfs求解,这里... 阅读全文
posted @ 2016-11-14 20:52 Lawliet__zmz 阅读(184) 评论(0) 推荐(0) 编辑
摘要:Children of the Candy CornTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12755 Accepted: 5481DescriptionThe cornfield maze is a popular Hal... 阅读全文
posted @ 2016-08-02 10:24 Lawliet__zmz 阅读(152) 评论(0) 推荐(0) 编辑
摘要:Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 75331 Accepted: 23781DescriptionFarmer John has been informed of the location ... 阅读全文
posted @ 2016-08-01 17:00 Lawliet__zmz 阅读(143) 评论(0) 推荐(0) 编辑
摘要:迷宫问题Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15775 Accepted: 9389Description定义一个二维数组:int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0,... 阅读全文
posted @ 2016-07-30 16:33 Lawliet__zmz 阅读(175) 评论(0) 推荐(0) 编辑
摘要:和上个DFS的问题一样,这次用BFS的思想,BFS没有像DFS那样专门有个step累加,是靠队列思想实现,更像一群路径竞速,最快的到达后,就break输出了#include struct node{ int x; int y; int f;//父亲在队列中的编号,本题不要求输出路径... 阅读全文
posted @ 2016-07-30 09:45 Lawliet__zmz 阅读(229) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示