![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索
长歌丶采薇
这个作者很懒,什么都没留下…
展开
-
迷宫问题——最简单的dfs
迷宫问题——最简单的bfs定义一个二维数组: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 ...原创 2018-10-31 18:15:59 · 320 阅读 · 0 评论 -
POJ - 1816 Wild Words(字典树 + 搜索)
POJ - 1816 Wild Words(字典树 + 搜索)A word is a string of lowercases. A word pattern is a string of lowercases, '?'s and ‘'s. In a pattern, a ‘?’ matches any single lowercase, and a '’ matches none or mor...原创 2019-08-06 21:52:06 · 228 阅读 · 0 评论 -
HDU - 5887 Herbs Gathering (搜索+剪枝解决的01背包)
HDU - 5887 Herbs Gathering (搜索+剪枝解决的01背包)Collecting one’s own plants for use as herbal medicines is perhaps one of the most self-empowering things a person can do, as it implies that they have take...原创 2019-07-07 19:55:24 · 222 阅读 · 0 评论 -
POJ - 3279 - Fliptile (翻转问题+DFS+思维 )
POJ - 3279 - Fliptile (翻转问题+DFS+思维 )Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate ...原创 2019-05-21 21:18:43 · 306 阅读 · 1 评论 -
POJ - 1562 Oil Deposits (DFS/BFS找连通块的个数)
POJ - 1562 Oil Deposits (DFS找连通块的个数)The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a tim...原创 2019-05-20 22:19:30 · 151 阅读 · 0 评论 -
POJ - 3126 (BFS)
POJ - 3126 (BFS)The 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 ...原创 2019-05-20 22:14:53 · 186 阅读 · 0 评论 -
POJ - 3278 Catch That Cow (bfs)
POJ - 3278 Catch That Cow (bfs)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 co...原创 2019-05-20 21:58:37 · 131 阅读 · 0 评论 -
POJ - 2251 Dungeon Master (三维地图内的 bfs 找最短距离)
POJ - 2251 Dungeon Master (三维地图内的 bfs 找最短距离)You 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...原创 2019-05-20 21:11:39 · 160 阅读 · 0 评论 -
UVA - 10047 The Monocycle(bfs)
UVA - 10047 The Monocycle(bfs)A monocycle is a cycle that runs on one wheel and the one we will be considering is a bit more special.It has a solid wheel colored with five different colors as shown ...原创 2018-12-07 13:22:59 · 188 阅读 · 0 评论 -
HDU - 2586 - How far away ? (最短路)
HDU - 2586 - How far away ? (最短路)There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this “How far is it if I want to go from house...原创 2018-12-20 00:16:23 · 211 阅读 · 0 评论 -
POJ - 1463-Strategic game(最小点覆盖)
POJ - 1463-Strategic game(最小点覆盖)Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following ...原创 2018-11-14 19:03:44 · 148 阅读 · 0 评论 -
hdu -1520-Anniversary party (树形DP)
hdu -1520-Almost Arithmetical Progression(树形DP)There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. ...原创 2018-11-10 00:45:54 · 143 阅读 · 0 评论 -
poj 1655 Balancing Act(树的重心+dfs)
poj 1655 Balancing Act(树的重心+dfs)Consider a tree T with N (1 <= N <= 20,000) nodes numbered 1…N. Deleting any node from the tree yields a forest: a collection of one or more trees. Define the ba...原创 2018-11-10 01:13:34 · 149 阅读 · 0 评论 -
2019牛客暑期多校训练营(第九场 --D Knapsack Cryptosystem 折半搜索)
2019牛客暑期多校训练营(第九场 --D Knapsack Cryptosystem 超大容量背包 搜索+ 思维)链接:https://ac.nowcoder.com/acm/contest/889/D来源:牛客网Amy asks Mr. B problem D. Please help Mr. B to solve the following problem.Amy wants to...原创 2019-08-15 18:45:56 · 163 阅读 · 0 评论