![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索&DFS&BFS
BoilTask
www.BoilTask.com
展开
-
【杭电】[2717]Catch That Cow
这里用了广搜 也就是每次 对m+1,m-1,m*2判断 遇到还没到过的点就加入搜索队列 直到目标点有了记录需要注意的是给搜索加入越界判断 防止有数组超限等情况原创 2016-03-18 23:14:48 · 316 阅读 · 0 评论 -
【杭电】[1241]Oil Deposits
Oil DepositsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground o原创 2016-07-29 12:01:02 · 304 阅读 · 0 评论 -
【杭电】[1010]Tempter of the Bone
Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. H原创 2016-07-29 15:58:48 · 326 阅读 · 0 评论 -
【POJ】[3279]Fliptile
FliptileTime Limit: 2000MSMemory Limit: 65536KDescriptionFarmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity原创 2016-07-29 20:44:55 · 252 阅读 · 0 评论 -
【UVa】[11624]Fire!
Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Help Joe escape the maze. Given Joe’s location in the ma原创 2016-07-30 11:03:55 · 391 阅读 · 0 评论 -
【杭电】[2612]Find a way
Find a wayTime Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionPass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave原创 2016-07-30 09:22:38 · 255 阅读 · 0 评论 -
【郑轻】[1900]985的“树”难题
1900: 985的“树”难题Time Limit: 1 Sec Memory Limit: 128 MBDescription985给你一棵“树”以及它的根节点,要求你先判定它是否是一棵树,其次他想知道每个节点的“太子”数目以及它的父亲(root的话输出自己)。“太子判定条件”:一、若x是y的孩子节点,那么x是y的“太子”;二、若x是y的“太子”且y是z的“原创 2016-08-03 20:55:51 · 355 阅读 · 0 评论 -
【POJ】[1985]Cow Marathon
After hearing about the epidemic of obesity in the USA, Farmer John wants his cows to get more exercise原创 2016-08-02 17:51:52 · 544 阅读 · 0 评论 -
【POJ】[2631]Roads in the North
Roads in the NorthTime Limit: 1000MS Memory Limit: 65536KDescriptionBuilding and maintaining roads among communities in the far North is an expensive business. With this in原创 2016-08-03 08:59:06 · 302 阅读 · 0 评论 -
【POJ】[1383]Labyrinth
先找出任意一点的最远点u,再找出u的最远点v,u-v距离即使最远距离,这题同样按照这种思路进行搜索原创 2016-08-03 09:39:09 · 354 阅读 · 0 评论 -
【POJ】[3620]Avoid The Lakes
Avoid The LakesTime Limit: 1000MSMemory Limit: 65536KDescriptionFarmer John's farm was flooded in the most recent storm, a fact only aggravated by the information that his cows are原创 2016-07-29 11:34:29 · 288 阅读 · 0 评论 -
【杭电】[1312]Red and Black
Red and BlackTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored eith原创 2016-07-29 10:51:50 · 293 阅读 · 0 评论 -
【POJ】[2251]Dungeon Master
Dungeon MasterTime Limit: 1000MSMemory Limit: 65536KDescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or ma原创 2016-07-29 10:34:16 · 279 阅读 · 0 评论 -
【杭电】[1242]Rescue
虽然学长把这题取名为BFS…… 不过一时脑抽没分清BFS是深搜还是广搜 所以用的DFS做的不过对于这种水题其实都一样啦 没什么坑点 用一个二维数组保存每个点到终点的距离 然后递归搜索 遇见x就+2 遇见.就+1原创 2016-03-29 17:48:43 · 309 阅读 · 0 评论 -
【杭电】[1495]非常可乐
看博客里面搜索分类下的题目也不是很多…… 为什么感觉做过好多搜索题了……-.-这一题还是很简单的 (话说突然感觉这种搜索都不难 设置好条件之后就不用动脑子了)首先若要可以倒可乐S&1==0也就是S应为偶数 然后当N==M时 很显然只需要一次 其余的进行搜索 终止条件是S里面有S/2的饮料 N M中较大的那个里有剩下的一半饮料然后……搜索就好了原创 2016-03-29 17:57:44 · 358 阅读 · 0 评论 -
【HPU】[1689]MZY寻宝
无聊灌灌水 这个亮点一些的是用两个数组 达到了以循环来代替了多次地分开写原创 2016-03-29 18:35:29 · 356 阅读 · 0 评论 -
【HPU】[1734]老王修公园
一个很简单的搜索题目 用的bfs原创 2016-03-24 20:10:35 · 455 阅读 · 0 评论 -
【HPU】[1737]老王特警队
需要注意坐标的对应 用了bfs原创 2016-03-24 20:19:03 · 338 阅读 · 0 评论 -
【杭电】[1998]奇数阶魔方
上次校赛出了这一题 也是初中无意中学的一个幻方定理这次用深搜写了一下原创 2016-04-14 07:01:03 · 393 阅读 · 0 评论 -
【POJ】[1321]棋盘问题
棋盘问题Time Limit: 1000MSMemory Limit: 10000KDescription在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两原创 2016-07-29 08:52:17 · 201 阅读 · 0 评论 -
【POJ】[1573]Robot Motion
Robot MotionTime Limit: 1000MSMemory Limit: 10000KDescriptionA robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to mo原创 2016-07-28 15:29:22 · 255 阅读 · 0 评论 -
【杭电】[1181]变形课
变形课Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Problem Description呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语原创 2016-07-28 11:57:50 · 288 阅读 · 0 评论 -
【杭电】[2196]Computer
ComputerTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionA school bought the first computer some time ago(so this computer's id is 1). Duri原创 2016-08-03 10:30:02 · 391 阅读 · 0 评论