BFS
Rocky0429
我愿能朝着太阳生长,做一个温暖的人。
展开
-
POJ 2049-Finding Nemo(三维bfs解决类迷宫问题)
Finding NemoTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 7902 Accepted: 1827DescriptionNemo is a naughty boy. One day he went into the deep sea all原创 2015-01-08 13:55:31 · 1592 阅读 · 0 评论 -
POJ 3414-Pots(BFS)
题目地址:POJ 3414 题意:给你a,b两个容器的容量,六种操作方法,问最少多少次可以使其中一个容器里的水达到体积c,如果不能的话则输出impossible。 思路:一共有6种操作方法,0:倒满a,1:倒满b,2:把a里的水倒向b(两种情况b倒满a有剩余或者a倒完),3:把b里的水倒向a(类似2的两种情况),4:把a倒空,5:把b倒空。然后用vis[i][j]记录当a的容量为i,b的容量为j原创 2015-08-16 18:29:07 · 1950 阅读 · 0 评论 -
HDU 5336(2015多校4)-XYZ and Drops(bfs)
题目地址:HDU 5336 题意:有一个r 行 c 列的格子,给出n个格子里有水滴的大小。再给出时间限制T,使得水滴从(sx,sy)位置开始爆破,当飞渐的水遇到格子里的静态水时就会聚在一起,当聚集的水滴大小>4时就会爆破。问在T时给定的n个位置格子里的水滴情况,如果没有爆破就输出:1 格子里水滴大小。否则输出:0 爆破的时间。#include <stdio.h>#include <math.h>原创 2015-08-01 16:21:29 · 1404 阅读 · 0 评论 -
UVA 439-Knight Moves(bfs)
Knight MovesTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionA friend of you is doing research on the Traveling Knight Problem (TKP)原创 2015-02-15 00:55:01 · 1364 阅读 · 0 评论 -
POJ 1426-Find The Multiple(bfs)
Find The MultipleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 19272 Accepted: 7813 Special JudgeDescriptionGiven a positive integer n, write原创 2015-02-20 18:04:57 · 1381 阅读 · 4 评论 -
POJ 3083-Children of the Candy Corn(dfs+bfs)
Children of the Candy CornTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10380 Accepted: 4485DescriptionThe cornfield maze is a popular Halloween t原创 2015-02-17 12:57:27 · 1389 阅读 · 0 评论 -
找朋友(bfs)
F - 找朋友Crawling in process...Crawling failedTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmitStatus DescriptionX,作为户外运动的忠实爱好者,总是不想呆在家里。现在,他想把死宅Y原创 2014-07-29 23:20:56 · 1392 阅读 · 0 评论 -
Pots(BFS)
PotsCrawling in process...Crawling failedTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmitStatus DescriptionYou are given two pots, having the vol原创 2014-07-29 23:40:49 · 1107 阅读 · 0 评论 -
胜利大逃亡(三维bfs)
胜利大逃亡Crawling in process...Crawling failedTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatus DescriptionIgnatius被魔王抓走了,有一天魔王出差去了,这可是Ignatiu原创 2014-07-29 23:30:45 · 1210 阅读 · 0 评论 -
数据结构实验图论一:基于邻接矩阵的广度优先搜索遍历
数据结构实验图论一:基于邻接矩阵的广度优先搜索遍历Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^题目描述给定一个无向连通图,顶点编号从0到n-1,用广度优先搜索(BFS)遍历,输出从某个顶点出发的遍历序列。(同一个结点的同层邻接点,节点编号小的优先遍历)输入输入第一行为整数n(0对于每组数据,第一行原创 2014-10-15 01:57:03 · 1669 阅读 · 0 评论 -
Catch That Cow(广度优先搜索_bfs)
Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 48036 Accepted: 15057DescriptionFarmer John has been informed of the location of a fug原创 2014-10-19 14:19:19 · 1489 阅读 · 0 评论 -
数据结构实验之图论二:基于邻接表的广度优先搜索遍历(BFS+前向星)
数据结构实验之图论二:基于邻接表的广度优先搜索遍历Time Limit: 1000MS Memory limit: 65536K题目描述给定一个无向连通图,顶点编号从0到n-1,用广度优先搜索(BFS)遍历,输出从某个顶点出发的遍历序列。(同一个结点的同层邻接点,节点编号小的优先遍历)输入输入第一行为整数n(0对于每组数据,第一行是三原创 2014-11-23 20:59:33 · 1660 阅读 · 0 评论 -
POJ 3126-Prime Path(BFS)
题目地址:POJ 3126 题意:给你两个4位的都是素数正整数n,m,每次可以变 个十百千位 中的一个数(变化后也是素数,问最少经过多少次变化n能变成m,如果不能输出Impossible(窝觉得并没有不成立的情况 思路:每次变化一位,然后搜就好了。#include <stdio.h>#include <math.h>#include <string.h>#include <stdlib.h原创 2015-08-16 15:59:47 · 1314 阅读 · 0 评论