![](https://img-blog.csdnimg.cn/2019091813595558.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
BFS
BFS
Guuuuuu老师儿
当初的算法竞赛题目博客的留言评论就不回复了,时间太久已经忘干净了,抱歉~
展开
-
列出连通集(25 分)(深搜广搜)
7-7 列出连通集(25 分)给定一个有N个顶点和E条边的无向图,请用DFS和BFS分别列出其所有的连通集。假设顶点从0到N−1编号。进行搜索时,假设我们总是从编号最小的顶点出发,按编号递增的顺序访问邻接点。输入格式:输入第1行给出2个整数N(0N≤10)和E,分别是图的顶点数和边数。随后E行,每行给出一条边的两个端点。每行中的数字之间用1空格分隔。输出格式:按照"原创 2017-10-27 20:03:25 · 545 阅读 · 0 评论 -
ACM-ICPC 2018 沈阳赛区网络预赛D-Made In Heave(A*+SPFA求第K最短路)
ACM-ICPC 2018 沈阳赛区网络预赛(D-Made In Heaven)A*+SPFA求第K最短路One day in the jail, F·F invites Jolyne Kujo (JOJO in brief) to play tennis with her. However, Pucci the father somehow knows it and wants to sto...原创 2018-09-10 11:01:51 · 218 阅读 · 0 评论 -
Oil Deposits HDU - 1241(BFS找连通分量)
Oil Deposits HDU - 1241 The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and crea...原创 2018-09-03 16:38:18 · 208 阅读 · 0 评论 -
Find a way HDU - 2612(两起点bfs)
Find a way HDU - 2612 Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki.Yifen...原创 2018-09-04 07:51:50 · 370 阅读 · 0 评论 -
Sparse Graph HDU - 5876(求补图最短路BFS)
Sparse Graph HDU - 5876In graph theory, the complement of a graph G is a graph H on the same vertices such that two distinct vertices of H are adjacent if and only if they are not adjacent in G.No...原创 2018-08-31 19:11:46 · 226 阅读 · 0 评论 -
Eight II HDU - 3567 (bfs打表+hash映射+康托展开)
Eight II HDU - 3567 Eight-puzzle, which is also called "Nine grids", comes from an old game. In this game, you are given a 3 by 3 boar...原创 2018-05-14 19:02:49 · 948 阅读 · 0 评论 -
Eight HDU - 1043 (八数码,BFS逆向打表+康托展开hash)
Eight HDU - 1043 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 constr...原创 2018-05-14 18:51:18 · 781 阅读 · 1 评论 -
Escape HDU - 3533 (BFS)
Escape HDU - 3533 The students of the HEU are maneuvering for their military training. The red army and the blue army are at war today...原创 2018-05-17 08:36:46 · 228 阅读 · 0 评论 -
Superbot ZOJ - 3865 (BFS)
Superbot ZOJ - 3865 Superbot is an interesting game which you need to control the robot on an N*M grid map. As you see, it's ju...原创 2018-04-25 20:58:13 · 285 阅读 · 0 评论 -
计蒜客-藏宝图(bfs+状压)
藏宝图 蒜头君得到一张藏宝图。藏宝图是一个 10×1010 \times 1010×10 的方格地图,图上一共有 101010 个宝藏。有些方格地形太凶险,不能进入。整个图只有一个地方可以出入,即是入口也是出口。蒜头君是一个贪心的人,他规划要获得所有宝藏以后才从出口离开。藏宝图上从一个方格到相邻的上下左右的方格需要 111 天的时间,蒜头君从入口出发,...原创 2018-03-28 20:05:35 · 597 阅读 · 2 评论 -
1094. The Largest Generation (25)(bfs)
1094. The Largest Generation (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue ...原创 2018-03-10 18:38:29 · 162 阅读 · 0 评论 -
1091. Acute Stroke (30)(bfs)
1091. Acute Stroke (30) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue One impor...原创 2018-03-10 18:05:54 · 205 阅读 · 0 评论 -
The Great Mixing CodeForces - 788C (BFS)
The Great MixingCodeForces - 788CSasha and Kolya decided to get drunk with Coke, again. This time they have k types of Coke. i-th type is characterised by its carbon dioxide concentrat原创 2018-01-29 18:24:43 · 317 阅读 · 0 评论 -
Pots POJ - 3414(BFS+路径还原)
Pots POJ - 3414You are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i) fill the pot i (1 ≤i ≤ 2) from the t原创 2017-11-05 10:12:51 · 259 阅读 · 0 评论 -
非常可乐(BFS)
非常可乐Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 17358 Accepted Submission(s): 7042Problem Description大家一定觉的运动以后喝可乐是一件很惬意的事情,但原创 2017-10-29 20:04:28 · 1346 阅读 · 0 评论 -
Fire Game(两点bfs)
Problem 2150 Fire GameAccept: 623 Submit: 2445Time Limit: 1000 mSec Memory Limit : 32768 KB Problem DescriptionFat brother and Maze are playing a kind of special (hentai) game on an N*M board (...原创 2017-10-21 17:27:55 · 217 阅读 · 0 评论 -
Find The Multiple(搜索)
Find The MultipleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 35088 Accepted: 14644 Special JudgeDescriptionGiven a positive integer n, write a pro原创 2017-10-29 16:47:54 · 2779 阅读 · 4 评论 -
Dice HDU - 5012(bfs)
Dice HDU - 5012 There are 2 special dices on the table. On each face of the dice, a distinct number was written. Consider a 1.a 2,a 3,a 4,a 5,a 6 to be numbers written on top face, bottom face, left...原创 2018-09-07 09:27:52 · 160 阅读 · 0 评论