bfs广度搜索
coding__girl
这个作者很懒,什么都没留下…
展开
-
UVA 336 A Node Too Far
题意: 给出点的个数及各个点之间的联通情况,输出从某点开始沿联通图路线走n步后不能到达的点的个数,0 0结束 思路: 用bfs搜索每个点#include <iostream> #include <map> #include <queue> #include <vector> using namespace std; //int vis[1000]; int N,T,cnt; map<int,v原创 2017-10-02 17:09:24 · 389 阅读 · 1 评论 -
UVA 417 Word Index
Encoding schemes are often used in situations requiring encryption or information storage/transmission economy. Here, we develop a simple encoding scheme that encodes particular types of words with ve原创 2017-10-02 17:30:08 · 403 阅读 · 0 评论 -
UVA 439 Knight Moves
A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to nd the shortest closed tour of knight moves that visits each square of a given set of n squares on a chessboard原创 2017-10-02 17:40:45 · 202 阅读 · 0 评论 -
UVA 532 Dungeon Master
You are trapped in a 3D dungeon and need to nd the quickest way out! The dungeon is composed of unit cubes which may or may not be lled with rock. It takes one minute to move one unit north, south, e原创 2017-10-03 13:48:29 · 245 阅读 · 0 评论 -
UVA 572 Oil Deposits
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 creates a grid that divides the原创 2017-10-03 14:06:34 · 227 阅读 · 0 评论