![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
广度优先BFS
five_east_west
这个作者很懒,什么都没留下…
展开
-
vijos 1076 海战——搜索题(bfs or dfs)
海战 背景在峰会期间,武装部队得处于高度戒备。警察将监视每一条大街,军队将保卫建筑物,领空将布满了F-2003飞机。此外,巡洋船只和舰队将被派去保护海岸线。不幸的是因为种种原因,国防海军部仅有很少的几位军官能指挥大型海战。因此,他们考虑培养一些新的海军指挥官,他们选择了“海战”游戏来帮助学习。描述在这个著名的游戏中,在一个方形的盘上放置了固定数量和形状的船只,每只船却不能碰到其它的船。在这个题中,我们仅考虑船是方形的,所有的船只都是由图形组成的方形。编写程序求出该棋盘上放置的船只的总数。格式输入原创 2020-09-14 11:10:47 · 727 阅读 · 0 评论 -
poj 3278 Catch That Cow——bfs
Catch That CowDescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,000) on the same number line.原创 2020-09-10 19:57:05 · 53 阅读 · 0 评论 -
poj 3414 Pots——bfs
PotsDescriptionYou 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 tap;DROP(i) empty the pot i to the drain;POUR(i,j) pour from原创 2020-09-10 11:11:10 · 95 阅读 · 0 评论 -
poj 3083 Children of the Candy Corn——dfs与bfs的混合
Children of the Candy CornDescriptionThe cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze facing zombies, chainsaw-wielding psychopaths, hippies, and other terrors on their quest to find the ex原创 2020-09-09 18:31:09 · 144 阅读 · 0 评论 -
poj 2251 Dungeon Master——BFS广度优先搜索
Dungeon MasterDescriptionYou 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, east, west, up or down. You原创 2020-09-07 17:57:56 · 91 阅读 · 0 评论 -
poj 2056 The Separator in Grid——BFS(广度优先搜索)
The Separator in GridDescriptionGiven a connected, undirected graph G = (V, E), where V is the vertex set consisting a collection of nodes, and E is the set of edges, each of which connects two nodes from V. A vertex subset S is a separator if the subgra原创 2020-09-07 12:47:09 · 196 阅读 · 0 评论 -
poj 1426 Find The Multiple——bfs广度优先搜索
Find The MultipleDescriptionGiven 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 200 and there is a corresponding m cont原创 2020-08-25 09:50:23 · 94 阅读 · 0 评论