![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
广搜
文章平均质量分 81
欧莎
啦啦啦,啦啦啦,让我们一起洗刷刷
展开
-
poj 3984 (bfs+输出路径)
Description定义一个二维数组: int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。 Input一个5 × 5的二维数组,表示一个迷宫原创 2016-08-06 08:54:04 · 709 阅读 · 0 评论 -
poj 3278 Catch That Cow
这里写链接内容 题意 :人追头牛,有两种交通方式一种是步行,步行每次每分钟只能前进一个单位,或者后退一个单位,另一前进到种交通方式是瞬移,瞬移的话每次每分钟只能从当前位置x ,前进到位置2x ,问从n 到k最少用多少时间。思路:我感觉很是惭愧啊, 这道题我做过的,但是呢 ,我却忘了,我刚开始用的深搜,没写出来,然后又用了最短路,还是没出来,后来我看了看自己以前写的代码,是用的广搜,后来用了广搜写原创 2016-07-27 22:38:05 · 266 阅读 · 0 评论 -
大钉骑马走江湖
江湖是什么,对于在象棋界厮杀的大钉来说,江湖就是一个矩阵,他的目标,就是在江湖之中骑着马,从他的位置出发,走到终点。当然,大钉的马也遵从中国象棋中的“马走日”的规则,而且在矩阵中,也会有一些障碍物,马不能跳到障碍物上;如果大钉的马面前有障碍物,即被“别马腿”,那么他将不能跳向有障碍物的左前和右前这两个方向。请问最少需要多少步,大钉才能骑着马跳到终点。输入格式:有多组测试样例。每原创 2016-04-25 17:27:52 · 406 阅读 · 0 评论 -
hdu 4771 Stealing Harry Potter's Precious(bfs+dfs)
Stealing Harry Potter's PreciousTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3717 Accepted Submission(s): 1643Problem Description Harr原创 2017-05-03 15:49:08 · 370 阅读 · 0 评论 -
ROADS POJ - 1724 (bfs+vector)
Description N cities named with numbers 1 … N are connected with one-way roads. Each road has two parameters associated with it : the road length and the toll that needs to be paid for the road (expre原创 2017-04-16 20:49:07 · 283 阅读 · 0 评论 -
第八届河南省程序设计大赛 B 最大岛屿(bfs)
题目描述 神秘的海洋,惊险的探险之路,打捞海底宝藏,激烈的海战,海盗劫富等等。加勒比海盗,你知道吧?杰克船长驾驶着自己的的战船黑珍珠1号要征服各个海岛的海盜,最后成为海盗王。 这是一个由海洋、岛屿和海盗组成的危险世界。面对危险重重的海洋与诡谲的对手,如何凭借智慧与运气,建立起一个强大的海盗帝国。杰克船长手头有一张整个海域的海图,上面密密麻麻分布着各个海屿的位置及面积。他想尽快知道整个海域共有多少原创 2017-04-18 17:16:52 · 373 阅读 · 0 评论 -
hud 5012 Dice(隐式图的搜索 )
Problem Description There are 2 special dices on the table. On each face of the dice, a distinct number was written. Consider a1.a2,a3,a4,a5,a6 to be numbers written on top face, bottom face, left fac原创 2017-04-12 15:29:08 · 209 阅读 · 0 评论 -
Mutual Training for Wannafly Union #6 Grid SPOJ - SERGRID A - Grid(bfs)
You are on an nxm grid where each square on the grid has a digit on it. From a given square that has digit k on it, a Move consists of jumping exactly k squares in one of the four cardinal directions.原创 2017-03-10 09:50:53 · 265 阅读 · 0 评论 -
poj 1376 Robot
DescriptionThe Robot Moving Institute is using a robot in their local store to transport different items. Of course the robot should spend only the minimum time necessary when travelling from one原创 2017-01-11 20:40:55 · 373 阅读 · 0 评论 -
hdu 1043 Eight(八数码问题 高级搜索: A* 搜索)
Problem DescriptionThe 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 1原创 2017-01-10 17:42:52 · 2654 阅读 · 0 评论 -
1908: 小火山的围棋梦想
题目链接天啊,这道题我调代码调了一天啊,代码能力太差,我也没有办法,,一天才调出来,心也赛赛的,天啊BFS#include<stdio.h>#include<stack>#include<iostream>#include<string.h>#include<algorithm>#include<queue>#include<string.h>#define LL long long原创 2016-08-12 13:28:49 · 422 阅读 · 0 评论