码迷,mamicode.com
首页 >  
搜索关键字:广搜    ( 525个结果
USACO shuttle
这道题用广搜即可,只需要加两个优化就行。。 代码如下: /* ID: m1500293 LANG: C++ PROG: shuttle */ #include <cstdio> #include <cstring> #include <algorithm> #include <queue> #inc
分类:其他好文   时间:2016-01-28 23:57:11    阅读次数:284
POJ 3126 primepath bfs
题目链接:http://poj.org/problem?id=3126题意:1维的坐标轴,给出起点和终点,求从起点到终点变换经历的最短的步数。起点,终点和中间变换的数字都是4位,而且都是质数。思路:普通的广搜、精神状态不佳、找了许久的bug。后来发现是prime函数和pow函数都很丧心病狂的写错了、...
分类:其他好文   时间:2016-01-23 00:50:54    阅读次数:297
BZOJ 1054 [HAOI2008]移动玩具
直接暴力广搜即可。。【网上有大神说双向广搜速度快,然而直接暴力广搜就可以过了】队列中的状态用二进制来存储。。我用了一个比较sb的写法,勿喷qaq 1 #include 2 #include 3 4 using namespace std; 5 6 unsigned int Start, En...
分类:移动开发   时间:2016-01-06 00:01:45    阅读次数:249
第一次广搜!HDU1548--A Strange Lift
一上来看见题目就用了深搜(因为只会深搜)果断内存超限(据说时间也会超限)无奈只好开始用广搜其实广搜的思路和深搜有很多类似的地方 不过实现的过程中用到了队列 因此有点难以理解(好吧我个人认为)这题是最基本的广搜了 只是一个二叉树所以先画个二叉树出来看一下广搜的顺序每一个节点下一层的节点入队之后就把这个...
分类:其他好文   时间:2015-12-11 22:10:07    阅读次数:221
广搜(棋)
题目网址:http://acm.uestc.edu.cn/#/problem/show/1221Ancient GoTime Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)SubmitStatus....
分类:其他好文   时间:2015-12-07 20:34:06    阅读次数:159
(简单广搜) Ice Cave -- codeforces -- 540C
http://codeforces.com/problemset/problem/540/CYou play a computer game. Your character stands on some level of a multilevel ice cave. In order to move...
分类:其他好文   时间:2015-11-19 14:30:22    阅读次数:162
hdu1430魔板(广搜+康托展开+string应用)
魔板Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2420Accepted Submission(s): 511Problem Descript...
分类:其他好文   时间:2015-11-08 22:21:21    阅读次数:319
VIJOS-P1340 拯救ice-cream(广搜+优先级队列)
题意:从s到m的最短时间。(“o"不能走,‘#’走一个花两个单位时间,‘.'走一个花一个单位时间)思路:广搜和优先队列。 1 #include 2 #include 3 #include 4 #include 5 #define MAX 30 6 using namespace ...
分类:其他好文   时间:2015-11-01 18:06:36    阅读次数:288
HDU 4101 Ali and Baba
两次广搜#include#include#include#include#includeusing namespace std;const int maxn=305;int N,M,Sx,Sy;int Map[maxn][maxn];int Y[maxn][maxn];int e[maxn][max...
分类:其他好文   时间:2015-11-01 16:29:14    阅读次数:264
POJ 3984 迷宫问题
题意:0可以走,1不可以走;正确做法应该是广搜(逃但是窝懒得看了,,回头再补,,用dfs水过去了,,忧桑,,AC代码:#include #include #include #include const int dx[4]= {0,0,1,-1};const int dy[4]= {1,-1,0,0}...
分类:其他好文   时间:2015-10-29 20:17:49    阅读次数:233
525条   上一页 1 ... 24 25 26 27 28 ... 53 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!