
bfs
文章平均质量分 62
ctsas
这个作者很懒,什么都没留下…
展开
-
The Game
One 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 consisting of w * h s原创 2017-02-04 18:30:00 · 349 阅读 · 0 评论 -
HDU - 3848 CC On The Tree [多端BFS]
CC lives on the tree which has N nodes.On every leaf of the tree there is an apple(leaf means there is only one branch connect this node ) .Now CC wants to get two apple ,CC can choose any node to star原创 2017-05-01 11:43:22 · 347 阅读 · 0 评论 -
[玲珑杯] Problem D: hipercijevi [bfs][卡时]
Description在遥远的星系, 最快的交通方式是用某种管道。 每个管道直接互相连接N个站。 那么我们从第一个站到第N个站最少要经过多少个站呢?Input输入文件的第一行为T表示有T组数据每个数据第一行包含三个正整数 N (1<=N<=100000) 表示站的个数; K (1<=K<=1000) 表示一个管道直接连接了多少个站; M (1<=M<=1000) 表示管道的数量。接下来的M行, 每行原创 2017-04-18 14:31:02 · 479 阅读 · 0 评论 -
[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 w原创 2017-03-03 18:40:33 · 252 阅读 · 0 评论 -
Knight Moves --bfs
BackgroundMr 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 ProblemYour task is to write a program原创 2017-02-04 12:29:31 · 296 阅读 · 0 评论 -
[Aizu]-0558 Cheese [BFS]
問題今年も JOI 町のチーズ工場がチーズの生産を始め,ねずみが巣から顔を出した.JOI 町は東西南北に区画整理されていて,各区画は巣,チーズ工場,障害物,空き地のいずれかである.ねずみは巣から出発して全てのチーズ工場を訪れチーズを 1 個ずつ食べる.この町には,N 個のチーズ工場があり,どの工場も1種類のチーズだけを生産している.チーズの硬さは工場によって異なっており,硬さ 1 から N までのチ原创 2017-03-03 09:03:18 · 1005 阅读 · 0 评论 -
Children of the Candy Corn [bfs][dfs]
The 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 ques原创 2017-02-06 19:59:52 · 340 阅读 · 0 评论 -
Dungeon Master [bfs]
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-02-06 16:11:19 · 247 阅读 · 0 评论 -
Prime Path [bfs]
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of se原创 2017-02-06 14:15:13 · 311 阅读 · 0 评论 -
Pots --bfs
You 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原创 2017-02-06 12:34:56 · 342 阅读 · 0 评论 -
Battle City
DescriptionMany of us had played the game “Battle city” in our childhood, and some people (like me) even often play it on computer now. What we are discussing is a simple edition of this game. Given a原创 2017-02-04 20:46:03 · 397 阅读 · 0 评论 -
Catch That Cow--bfs 与 优化
Farmer 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,00原创 2017-02-04 11:40:41 · 258 阅读 · 0 评论 -
[HPUOJ] 1152: 棋盘变换 [搜索]
题目描述给定一个4*4的01棋盘,1代表棋子,0代表空格,棋子1每次可以移动到相邻上下左右四个位置的空格。然后再给定你目标棋盘,问你最少在多少步能把当前棋盘变成目标棋盘状态。输入第一行输入一个整数T,代表有T组测试数据。接下来给出只有0和1的4*4的当前棋盘和4*4的目标棋盘,中间有一个空行。输出输出一个整数表示最小的步数,若不能到达输出-1。样例输入1 0001 0011 1100 111原创 2017-06-26 13:16:57 · 615 阅读 · 0 评论