
【BFS】
WangMeow
这个作者很懒,什么都没留下…
展开
-
[POJ](3669)Meteor Shower ---- bfs+预处理
DescriptionBessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her原创 2017-11-29 18:50:09 · 256 阅读 · 0 评论 -
[AtCoder](3621)Small Multiple ---- 思维+BFS
Problem StatementFind the smallest possible sum of the digits in the decimal notation of a positive multiple of K.Constraints2≤K≤105 K is an integer.InputInput is given from Standard Input i...原创 2018-08-06 10:17:39 · 322 阅读 · 0 评论 -
[YTU](3273)吃鸡之团队合作 ---- BFS
Description暑假就要开始啦!小伙伴们又可以肆无忌惮的开黑吃鸡了喵!我们知道开黑吃鸡最重要的当然是团队合作了。在一个地图中,一个小队的玩家之间的距离不能太远,这样当队友遇到危险被击倒时才能保证有队友可以在足够的时间内赶过去。现在,我们有一个N*N的地图,其中“#”表示无法跨越的障碍物,其余符号均可通过,大写字母“A”-“Z”表示小队编号,队员在每个单位时间内只能上下左右移动一格(每个小...原创 2018-06-09 18:45:32 · 467 阅读 · 0 评论 -
[FZU](2150)Fire Game ---bfs
Problem DescriptionFat 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原创 2017-10-01 17:58:03 · 206 阅读 · 0 评论 -
[POJ](1426)Find The Multiple(Special Judge) ---bfs
DescriptionGiven 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 greater than 20原创 2017-09-28 20:44:19 · 207 阅读 · 0 评论 -
[HDU](2612)Find a way ---bfs
Find a wayTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 17354 Accepted Submission(s): 5582Problem DescriptionPass a year le原创 2017-09-28 16:30:08 · 217 阅读 · 0 评论 -
[POJ](2251)Dungeon Master ---三维bfs
Dungeon MasterTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 37721 Accepted: 14415DescriptionYou are trapped in a 3D dungeon and need to find the quick原创 2017-09-26 22:14:55 · 196 阅读 · 0 评论 -
[YTU](3166)共享单车 ---bfs
3166: 共享单车Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 45 Solved: 19[Submit][Status][Web Board]Description共享单车走进烟台,小明决定尝试。小明启动共享单车app,轻松地找到附近的单车。那么问题来了,到最近的那辆单车,小明大约要走多少米呢?现在简原创 2017-09-26 20:51:06 · 557 阅读 · 1 评论 -
[POJ](3984)迷宫问题 ---BFS+队列模拟(图+队列模拟)***
迷宫问题Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 24415 Accepted: 14241Description定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0原创 2017-08-22 16:50:27 · 227 阅读 · 0 评论 -
[HDU](1782)逃离迷宫 ---BFS(图)
逃离迷宫Problem Description 给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方向感原创 2017-08-16 20:48:07 · 363 阅读 · 0 评论 -
[SDUT](3468)广度优先搜索练习之神奇的电梯 ---BFS(图)
广度优先搜索练习之神奇的电梯Time Limit: 1000MS Memory Limit: 65536KBSubmit Statistic DiscussProblem Description有一座已知层数为n的高楼,这座高楼的特殊之处在于只能靠电梯去上下楼,所以要去到某一层要非常耽误时间,然而更悲哀的是,这座高楼的电梯是限号的,小鑫最开始的时候在1层,他想去第x原创 2017-08-11 12:29:53 · 281 阅读 · 0 评论 -
[POJ](3278)Catch That Cow ---BFS(图)
Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 96514 Accepted: 30289DescriptionFarmer John has been informed of the location of a fugitiv原创 2017-08-09 20:18:28 · 180 阅读 · 0 评论 -
[SDUT](2139)图结构练习——BFS——从起始点到目标点的最短步数 ---BFS(图)
第一行包含两个整数n,m(分别代表n个隘口,这些隘口之间有m个通道)。下面m行每行包含两个整数a,b;表示从a出发有一条通道到达b隘口(注意:通道是单向的)。 Output 如果天灾军团可以不修建任何通道就到达1号隘口,那么输出最少经过多少通道,否则输出NO。 Example Input2 11 22 12 1Example O原创 2017-08-09 16:25:37 · 348 阅读 · 0 评论 -
[SDUT](2141)数据结构实验之图论一:基于邻接矩阵的广度优先搜索遍历 ---BFS(图)
数据结构实验之图论一:基于邻接矩阵的广度优先搜索遍历Time Limit: 1000MS Memory Limit: 65536KBSubmit Statistic DiscussProblem Description给定一个无向连通图,顶点编号从0到n-1,用广度优先搜索(BFS)遍历,输出从某个顶点出发的遍历序列。(同一个结点的同层邻接点,节点编号小的优先遍历)原创 2017-08-08 20:51:27 · 1012 阅读 · 0 评论 -
Codeforces Round #516 (Div. 2) D. Labyrinth ---- BFS+思维
题目传送门做法:优先选取列,然后在向左右扩展。然鹅,有思路,却不会处理,看了本场Rank1,有双端队列巧妙处理列和行的优先级,才发现处理更简洁+易懂。ORZ我们优先将列放到队首,因为列是不需要消耗步数的,然后再将左右放到队尾,然后依次访问+标记,即可。AC代码:#include<bits/stdc++.h>#define IO ios_base::s...原创 2018-10-15 12:46:24 · 159 阅读 · 0 评论