
BFS
文章平均质量分 78
luer9
假如我年少有为。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
PAT 1079 Total Sales of Supply Chain
1079Total Sales of Supply Chain(25分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Startin...原创 2020-05-02 14:19:52 · 205 阅读 · 0 评论 -
POJ 1860 Currency Exchange(Bellman_Ford,Spfa)
Currency ExchangeTime Limit:1000MS Memory Limit:30000K Total Submissions:42517 Accepted:16354 DescriptionSeveral currency exchange points are working in our city. Let us su...原创 2019-08-13 15:20:02 · 176 阅读 · 0 评论 -
HDU 1044 Collect More Jewels (BFS+DFS)
Collect More JewelsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8917 Accepted Submission(s): 2096 Problem DescriptionIt is written...原创 2019-01-20 18:12:16 · 272 阅读 · 0 评论 -
HDU 1043 Eight (bfs 康托展开 )
EightTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 32621 Accepted Submission(s): 8488Special JudgeProblem DescriptionThe 15-puzzle ha...原创 2019-01-20 13:28:04 · 202 阅读 · 0 评论 -
HDU 1026 Ignatius and the Princess I (BFS,路径输出)
Ignatius and the Princess ITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22707 Accepted Submission(s): 7314Special Judge Problem Desc...原创 2018-12-23 23:45:43 · 227 阅读 · 0 评论 -
哈尔滨理工大学软件与微电子学院第八届程序设计竞赛同步赛(高年级)F-小乐乐下象棋
链接:https://ac.nowcoder.com/acm/contest/301/F来源:牛客网 题目描述小乐乐一天天就知道玩,这一天又想玩象棋。我们都知道马走日。现在给定一个棋盘,大小是n*m,把棋盘放在第一象限,棋盘的左下角是(0,0),右上角是(n - 1, m - 1);小乐乐想知道,一个马从左下角(0, 0)开始,走了k步之后,刚好走到右上角(n - 1, m - ...原创 2018-12-02 22:59:40 · 261 阅读 · 0 评论 -
HDU1072 Nightmare(dfs、bfs、记忆化搜索)
Ignatius had a nightmare last night. He found himself in a labyrinth with a time bomb on him. The labyrinth has an exit, Ignatius should get out of the labyrinth before the bomb explodes. The initial ...原创 2018-08-14 14:21:37 · 296 阅读 · 0 评论 -
PTA 7-13 列出连通集(bfs dfs)
7-13 列出连通集给定一个有N个顶点和E条边的无向图,请用DFS和BFS分别列出其所有的连通集。假设顶点从0到N−1编号。进行搜索时,假设我们总是从编号最小的顶点出发,按编号递增的顺序访问邻接点。输入格式:输入第1行给出2个整数N(0<N≤10)和E,分别是图的顶点数和边数。随后E行,每行给出一条边的两个端点。每行中的数字之间用1空格分隔。输出格式:按照"{ v1...原创 2018-07-23 08:47:32 · 508 阅读 · 0 评论 -
Aizu - 0558 Cheese
チーズ ()問題在H * W的地图上有N个奶酪工厂,每个工厂分别生产硬度为1-N的奶酪。有一只老鼠准备从出发点吃遍每一个工厂的奶酪。老鼠有一个体力值,初始时为1,每吃一个工厂的奶酪体力值增加1(每个工厂只能吃一次),且老鼠只能吃硬度不大于当前体力值的奶酪。 老鼠从当前格到上下左右相邻的无障碍物的格需要时间1单位,有障碍物的格不能走。走到工厂上时即可吃到该工厂的奶酪,吃奶酪时间不计。问吃遍所有奶酪最...转载 2018-06-18 20:53:50 · 352 阅读 · 0 评论 -
poj3984 迷宫问题
迷宫问题Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 30545 Accepted: 17549Description定义一个二维数组: 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...转载 2018-05-08 22:19:36 · 231 阅读 · 0 评论 -
BFS DFS
图是一种灵活的数据结构,一般作为一种模型用来定义对象之间的关系或联系。对象由顶点(V)表示,而对象之间的关系或者关联则通过图的边(E)来表示。 图可以分为有向图和无向图,一般用G=(V,E)来表示图。经常用邻接矩阵或者邻接表来描述一副图。 在图的基本算法中,最初需要接触的就是图的遍历算法,根据访问节点的顺序,可分为广度优先搜索(BFS)和深度优先搜索(DFS)。广度优先搜索(BFS转载 2018-04-08 19:02:10 · 146 阅读 · 0 评论 -
POJ - 2251 Dungeon Master
Dungeon MasterTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 41886 Accepted: 15859DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed o...转载 2018-02-27 20:57:55 · 187 阅读 · 0 评论 -
POJ - 3126 Prime Path
首相们对安全局长带来的消息感到非常不安,他们说他们将为了安全考虑改变首相房间门牌号上面的门牌号码。——要不时地改变门牌号,这样可以使敌人处于迷惑之中。——但是,我现在的门牌号是1033号,它是一个质数,我有质数强迫症。我不能忍受我的门牌号不是质数。——我知道,所以你的新门牌号8179号也是一个质数。你只需在你办公室的门上更换掉原来的四个数字就可以。——不,不是那么简单。假设我把第一原创 2018-01-26 20:39:27 · 414 阅读 · 0 评论 -
POJ-3278 Catch that cow
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 point K (0 ≤ K ≤ 100,0原创 2018-01-25 20:21:29 · 211 阅读 · 0 评论