![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
BFS&DFS
心夏心冬
心夏心冬
展开
-
OY问题
1210: OY问题 [搜索] 时间限制: 1 Sec 内存限制: 128 MB 提交: 73 解决: 9 状态 题目描述 OY是什么意思?那么oyt你知不知道呢? (这拼音首字母真的是一点加密性都没有) 没错,OY就是这个意思(某人的姓),那么你能分得清“O”怎么写和“Y”怎么写吗? 在计算机里,可以用0代表无色,用1代表黑色,这样对上面的图片进行处理就原创 2017-02-15 10:07:51 · 618 阅读 · 0 评论 -
HDU4707pet
DescriptionOne day, Lin Ji wake up in the morning and found that his pethamster escaped. He searched in the room but didn’t find the hamster. He tried to use some cheese to trap the hamster. He put the原创 2017-08-03 09:53:10 · 233 阅读 · 0 评论 -
Dungeon Master BFS
DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit no原创 2017-08-02 10:24:45 · 232 阅读 · 0 评论 -
LightOJ - 1141 Number Transformation bfs
DescriptionIn this problem, you are given an integer number s. You can transform any integer number A to another integer number B by adding x to A. This x is an integer number which is a prime factor o原创 2017-08-01 09:47:25 · 257 阅读 · 0 评论 -
CodeForces - 723D Lakes in Berland dfs
DescriptionThe map of Berland is a rectangle of the size n × m, which consists of cells of size 1 × 1. Each cell is either land or water. The map is surrounded by the ocean.Lakes are the maximal region原创 2017-08-01 09:26:36 · 221 阅读 · 0 评论 -
HDU - 2266How Many Equations Can You Find dfs
DescriptionNow give you an string which only contains 0, 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9.You are asked to add the sign ‘+’ or ’-’ between the characters. Just like give you a string “12345”, you can work out原创 2017-08-01 09:17:43 · 401 阅读 · 0 评论 -
Tempter of the Bone HDU - 1010 dfs 剪枝
DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that原创 2017-08-01 09:15:06 · 168 阅读 · 0 评论 -
DFS 入门
Red and BlackDescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adja原创 2017-07-31 21:54:49 · 318 阅读 · 0 评论 -
当然选择原谅她呀 DFS
Description小陈和小白是一对恩爱的夫妻, 可是有一天小白被困在了大魔王小张的手里, 小张将小白困在了迷宫的最右下角,于是小陈打算从迷宫的左上角出发去找到她并且原谅她呀!Input输入文件将包含一组或者几组数据。每组测试数据包含一个n, m(0 < n,m <= 20)表示迷宫的行数和列数。紧跟着一个n行m列的矩阵表示一个迷宫, 其中的1表示墙壁,0表示可以走的路, 只能横着走或者竖着走,原创 2017-06-08 08:20:41 · 351 阅读 · 0 评论 -
Vegetable and Park [搜索]
毕业后,Vegetable在一家建筑公司找到了工作。他所在的城市将要进行整修,要求把所有空地修成公园。市区是一个N*M的矩形,Vegetable拿到了该市的地图,现在判断共要修几处公园?注意:在一片空地上,它上下左右的位置是空地,则视为统一片空地。输入 共有T组测试数据,每组测试数据包含一组N和M(0#include<cstdio> #include<cstring> #include<cmath原创 2017-03-06 22:33:40 · 392 阅读 · 0 评论 -
放苹果
Macro非常喜欢吃梨,有一天他得到了ACMICPC组委会送给他的一筐梨子。他比较心疼学生,就打算把梨子分给学生吃。现在他要把M个梨子放到N个盘子里面 (我们允许有的盘子为空) ,你能告诉Macro有多少种分法吗?(请注意,如果有三个盘子,我们将5,1,1和1,1,5,视为同一种分法)输入 第一行是一个整数t,代表有t组样例。第二行有两个整数M 和 N 代表有M个梨和N个盘子。输出 输出有多少种原创 2017-02-26 14:18:23 · 397 阅读 · 0 评论 -
zzuli 2174 dfs
题目大意问是否能把一串数字分解成两串长度相等且完全一样的数字 能 输出 竟然还有这种操作否则输出 没有这种操作思路再开两个数组 dfs 难点在于dfs的实现#include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<stack> #include<queue> #include<iostre原创 2017-08-22 15:45:47 · 358 阅读 · 0 评论