搜索
西瓜君wtml
这个作者很懒,什么都没留下…
展开
-
kuangbin专题一简单搜索 k 迷宫问题
K - 迷宫问题定义一个二维数组: 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的二维数组,表示一个迷宫。数据保证原创 2017-09-05 16:43:03 · 302 阅读 · 0 评论 -
hdu 1501 记忆化搜索+DFS
Problem Description Given three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The first two strings can be mixed arbitraril原创 2018-03-15 22:21:50 · 287 阅读 · 0 评论 -
hdu 1518 DFS+剪枝
Problem Description Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square?Input The first line of input contains N, the number of test cases. Each test cas原创 2018-03-15 22:19:58 · 160 阅读 · 0 评论 -
hdu 1548 bfs
Problem Description There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up and down.When you原创 2017-08-29 07:48:29 · 300 阅读 · 0 评论 -
hdu 1241 dfs求连通块
Problem Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a原创 2017-08-28 20:41:59 · 237 阅读 · 0 评论 -
kuangbin 简单搜索 I - Fire Game
I - Fire GameFat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just empty and the原创 2017-09-11 12:12:15 · 224 阅读 · 0 评论 -
kuangbin 简单搜索 J 双bfs
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原创 2017-09-10 21:55:20 · 299 阅读 · 0 评论 -
kuangbin 简单搜索 H题
H - PotsYou are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap; DROP(i) empty t原创 2017-09-10 10:55:20 · 218 阅读 · 0 评论 -
kuangbin 简单搜索 F题
F - Prime PathThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is原创 2017-09-07 14:19:48 · 276 阅读 · 0 评论 -
hdu 2612 双bfs最短路
Problem Description Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki. Yifenfei原创 2017-09-08 11:38:09 · 293 阅读 · 0 评论 -
hdu 1253 bfs
Problem Description Ignatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会.魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,C-1)的位置,现在知道魔王将在T分钟后回到城堡,Ignatius每分钟能从一个坐标走到相邻的六个坐标中的其中一原创 2017-09-07 17:00:58 · 160 阅读 · 0 评论 -
kuangbin 简单搜索 E
E - Find The MultipleGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greate原创 2017-09-06 21:52:52 · 199 阅读 · 0 评论 -
kuangbin 简单搜索 L题
L - Oil DepositsThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid原创 2017-09-06 21:05:10 · 250 阅读 · 0 评论 -
kuangbin 简单搜索 B
B - Dungeon MasterYou 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原创 2017-09-06 20:42:50 · 386 阅读 · 0 评论 -
51nod 1268 和为k的组合
1268 和为K的组合基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 收藏 关注 给出N个正整数组成的数组A,求能否从中选出若干个,使他们的和为K。如果可以,输出:”Yes”,否则输出”No”。 Input 第1行:2个数N, K, N为数组的长度, K为需要判断的和(2 <= N <= 20,1 <= K <= 10^9) 第2 - N + 1行:每行原创 2017-09-02 15:00:53 · 265 阅读 · 0 评论 -
hdu 1242 bfs
Problem Description Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison.Angel’s原创 2017-09-06 11:27:43 · 211 阅读 · 0 评论 -
kuangbin 简单搜索C题
Problem Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a po原创 2017-09-05 21:52:57 · 301 阅读 · 0 评论 -
kuangbin 简单搜索 A 棋盘问题
A - 棋盘问题在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <=原创 2017-09-05 20:01:44 · 208 阅读 · 0 评论 -
hdu 1728 bfs变形
Problem Description 给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方向感的人,因此,她在行走过程中,不原创 2018-03-27 10:38:38 · 209 阅读 · 0 评论