搜索
Yi_Qing_Z
这个作者很懒,什么都没留下…
展开
-
HDU 3567 Eight II (BFS+映射+康托展开)
题面Eight-puzzle, which is also called "Nine grids", comes from an old game.In this game, you are given a 3 by 3 board and 8 tiles. The tiles are numbered from 1 to 8 and each covers a grid. As you s...原创 2019-02-14 22:08:02 · 757 阅读 · 0 评论 -
HDU 1067 Gap(bfs+哈希)
题面Let's play a card game called Gap.You have 28 cards labeled with two-digit numbers. The first digit (from 1 to 4) represents the suit of the card, and the second digit (from 1 to 7) represents th...转载 2019-04-18 12:03:36 · 151 阅读 · 0 评论 -
HDU 3085 Nightmare Ⅱ(初学双向BFS)
题面Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a big maze separately. More terribly, there are two ghosts in the maze. They will kill t...转载 2019-04-17 22:54:21 · 172 阅读 · 0 评论 -
UVA 1063 Marble Game(模拟+搜索)
题面A Marble Game is played with M marbles on a square board. The board is divided into N ×N unit squares, and M of those unit squares contain holes. Marbles and holes are numbered from 1 to M. The go...原创 2019-07-06 22:39:23 · 582 阅读 · 0 评论 -
ZOJ 2477 Magic Cube (IDA*)
题面This is a very popular game for children. In this game, there's a cube, which consists of 3 * 3 * 3 small cubes. We can unwrap the cube, it will become like this:w w ww w ww ...原创 2019-04-02 21:55:08 · 448 阅读 · 0 评论 -
POJ 2449 Remmarguts' Date(Dijkstra+A*)
题面Description"Good man never makes girls wait or breaks an appointment!" said the mandarin duck father. Softly touching his little ducks' head, he told them a story."Prince Remmarguts lives in h...转载 2019-03-13 19:37:14 · 163 阅读 · 0 评论 -
HDU 1560 DNA sequence(初学IDA*)
题面The twenty-first century is a biology-technology developing century. We know that a gene is made of DNA. The nucleotide bases from which DNA is built are A(adenine), C(cytosine), G(guanine), and T...转载 2019-03-13 21:27:01 · 135 阅读 · 0 评论 -
BFS与DFS的比较
问题1:什么时候用BFS,什么时候用DFS?链接:九章算法:能不能系统讲讲什么时候用BFS和DFS?1.BFS是用来搜索最短径路的解是比较合适的,比如求最少步数的解,最少交换次数的解,因为BFS搜索过程中遇到的解一定是离根最近的,所以遇到一个解,一定就是最优解,此时搜索算法可以终止。这个时候不适宜使用DFS,因为DFS搜索到的解不一定是离根最近的,只有全局搜索完毕,才能从所有解中找出离根的...转载 2019-03-09 10:15:25 · 967 阅读 · 0 评论 -
UVA1052 Bit Compressor(DFS)
题面The aim of data compression is to reduce redundancy in stored or communicated data. This increases effective data density and speeds up data transfer rates. One possible method to compress any bina...原创 2019-03-06 16:12:10 · 1811 阅读 · 1 评论 -
PAT (Advanced Level) 1003 Emergency(DFS)
题面1003 Emergency (25 分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue t...原创 2019-02-25 23:01:38 · 136 阅读 · 0 评论 -
HDU 2579 Dating with girls(2) BFS
题解:https://blog.csdn.net/hnust_xiehonghao/article/details/9018463 思路来源上一篇题解,除了变量名不同、多写了一个函数之外没有什么不同。 具体请见上面这篇题解 解题关键,visit[][][]三维判断是否可以走这个点。时间周期是k,那么到达该点会有k种不同的状态 以不同状态访问该点是不一样的,所以...转载 2019-02-13 11:38:28 · 152 阅读 · 0 评论 -
CodeForces 453C Little Pony and Summer Sun Celebration (dfs)
题解:https://blog.csdn.net/keshuai19940722/article/details/38352623 看完上面这篇题解,写出来了这道搜索题,思路基本都来自上面这篇题解用answer[]数组来记录所要输出的路径(答案),visit[]标记该节点是否访问过 用condition[]记录每个节点的访问状态 定义一个record数组:访问该节点,把他的访...转载 2019-02-13 11:38:01 · 124 阅读 · 0 评论 -
HDU 1043 Eight (八数码问题 康托展开 bfs)
题面The 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 15 on it, and all pa...转载 2019-02-13 11:17:45 · 295 阅读 · 0 评论 -
Codeforces 560D Equivalent Strings(暴力递归)
题面Today on a lecture about strings Gerald learned a new definition of string equivalency. Two strings a and b of equal length are called equivalent in one of the two cases:They are equal. If we s...原创 2019-02-18 17:07:59 · 246 阅读 · 0 评论 -
HDU 3533 Escape (预处理+BFS)
题目The students of the HEU are maneuvering for their military training.The red army and the blue army are at war today. The blue army finds that Little A is the spy of the red army, so Little A has ...原创 2019-02-15 14:11:21 · 233 阅读 · 0 评论 -
HDU 6370 Werewolf 狼人杀(dfs)
题面"The Werewolves" is a popular card game among young people.In the basic game, there are 2 different groups: the werewolves and the villagers.Each player will debate a player they think is a werew...原创 2020-11-11 15:14:55 · 201 阅读 · 0 评论