
bfs
UCAS王小二
不念过去,不畏未来...
展开
-
nyoj 58最少步数 BFS+优先队列
最少步数时间限制:3000 ms | 内存限制:65535 KB难度:4描述这有一个迷宫,有0~8行和0~8列: 1,1,1,1,1,1,1,1,1 1,0,0,1,0,0,1,0,1 1,0,0,1,1,0,0,0,1 1,0,1,0,1,1,0,1,1 1,0,0,0,0,1,0,0,1 1,1,0,1,0,1,0,0原创 2017-02-28 23:03:26 · 384 阅读 · 2 评论 -
zzlui 1726: 迷宫【BFS】
题目描述 在很多 RPG (Role-playing Games) 游戏中,迷宫往往是非常复杂的游戏环节。通常来说,我们在走迷宫的时候都需要花非常多的时间来尝试不同的路径。但如果有了算法和计算机的帮助,我们能不能有更快的方式来解决这个问题?我们可以进行一些尝试。 现在我们有一个 N 行 M 列的迷宫。迷宫的每个格子如果是空地则可以站人,如果是障碍则不行。在一个格子上,我们可以一步移动到它相邻的...原创 2018-04-23 18:48:56 · 202 阅读 · 0 评论 -
poj 1101 The Game【BFS+思维】
DescriptionOne morning, you wake up and think: "I am such a good programmer. Why not make some money?'' So you decide to write a computer game. The game takes place on a rectangular board consis原创 2017-08-30 22:34:02 · 802 阅读 · 0 评论 -
1280: 诡异的迷宫【BFS】
1280: 诡异的迷宫时间限制: 2 秒 内存限制: 128 MB提交: 84 解决: 12提交 状态 题目描述Simple最近刷题(打游戏)刷多了,一觉醒来发现自己到了一个迷宫里,怎么也出不去了。这时传来了一句话,告诉Simple必须按顺序收集完所有的宝石,才能出迷宫。所谓的顺序,就是按照每块宝石上英文字母的顺序。迷宫里面还有一些传送门,可以传送到任意一个另外原创 2017-08-05 10:53:02 · 407 阅读 · 0 评论 -
poj 1383 Labyrinth【bfs+队列】
LabyrinthTime Limit: 2000MS Memory Limit: 32768KTotal Submissions: 4184 Accepted: 1564DescriptionThe northern part of the Pyramid contains a very large and原创 2017-08-04 12:26:15 · 335 阅读 · 0 评论 -
1094 - Farthest Nodes in a Tree【前向星+bfs】
点击打开题目1094 - Farthest Nodes in a Tree PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBGiven a tree (a connected graph原创 2017-08-04 20:20:16 · 254 阅读 · 0 评论 -
LightOJ - 1094 Farthest Nodes in a Tree【bfs+前向星||vector存图】
点击打开题目 1094 - Farthest Nodes in a Tree PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Given a tree (a connected graph with no cycles), you have to find the farthe原创 2017-08-03 21:51:21 · 332 阅读 · 0 评论 -
hdu 2631 Roads in the North【树的直径+前向星存图】
Roads in the NorthTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2933 Accepted: 1442DescriptionBuilding and maintaining roads among communities in th原创 2017-08-04 09:43:50 · 339 阅读 · 0 评论 -
LightOJ - 1141【bfs+分解质因子】
In this problem, you are given an integer number s. You can transform any integer number A to another integer number B by adding x to A. This x is an integer number which is a prime factor of A (please原创 2017-08-01 18:11:39 · 365 阅读 · 0 评论 -
POJ - 3026 Borg Maze【BFS+prim】
Borg MazeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 14533 Accepted: 4728DescriptionThe Borg is an immensely powerful race of enhanced humanoids f原创 2017-07-18 17:28:02 · 280 阅读 · 0 评论 -
UESTC - 149 解救小Q【BFS】
小Q被邪恶的大魔王困在了迷宫里,love8909决定去解救她。 迷宫里面有一些陷阱,一旦走到陷阱里,就会被困身亡:(,迷宫 里还有一些古老的传送阵,一旦走到传送阵上,会强制被传送到 传送阵的另一头。现在请你帮助love8909算一算,他至少需要走多少步才能解 救到小Q?Input第一行为一个整数TT,表示测试数据组数。每组测试数据第一行为两个整数NN,MM,(1原创 2017-07-18 19:01:52 · 694 阅读 · 0 评论 -
POJ - 1573 bfs
A robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions areN north (up the原创 2017-04-13 23:34:12 · 269 阅读 · 0 评论 -
poj2251 Dungeon Master
You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south原创 2017-03-03 07:53:39 · 298 阅读 · 0 评论 -
hdu1372 Knight Moves
Background Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can you beat him?The Problem Your task is to write原创 2017-03-02 13:36:10 · 351 阅读 · 0 评论 -
poj3278 Catch That Cow(剪枝)
Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 84727 Accepted: 26603DescriptionFarmer John has been informed of the location of a fugit原创 2017-03-01 23:51:53 · 367 阅读 · 0 评论 -
poj2312 BFS+优先队列
Battle CityTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8584 Accepted: 2876DescriptionMany of us had played the game "Battle city" in our childhood,原创 2017-03-01 00:25:51 · 344 阅读 · 0 评论 -
hdu1242 Rescue BFS+优先队列
RescueTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 29050 Accepted Submission(s): 10268Problem DescriptionAngel was caught原创 2017-02-28 23:10:48 · 402 阅读 · 0 评论 -
Manthan, Codefest 18 (rated, Div. 1 + Div. 2) D. Valid BFS?【set+BFS】
题意:给你一颗树(无向图),问你是否满足BFS序? 分析:用dfs把树隔离出来,然后bfs去遍历,看是否满足;由于兄弟节点顺序可能不一致,用set查找。#include <bits/stdc++.h>#include <ext/rope>using namespace std;using namespace __gnu_cxx;#define met(s) m...原创 2018-09-03 09:02:56 · 410 阅读 · 0 评论