
宽度优先搜索
文章平均质量分 65
Roy_Yuan
直到退役依然很菜的小白
展开
-
BFS-POJ-3984-迷宫问题
迷宫问题 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11333 Accepted: 6784 Description定义一个二维数组: int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0,原创 2015-08-09 16:29:37 · 456 阅读 · 0 评论 -
DFS-BZOJ-1619-[Usaco2008 Nov]Guarding the Farm 保卫牧场
DescriptionThe farm has many hills upon which Farmer John would like to place guards to ensure the safety of his valuable milk-cows. He wonders how many guards he will need if he wishes to put one on t原创 2016-04-26 16:27:03 · 614 阅读 · 0 评论 -
BFS-BZOJ-1615-[Usaco2008 Mar]The Loathesome Hay Baler麻烦的干草打包机
DescriptionFarmer John新买的干草打包机的内部结构大概算世界上最混乱的了,它不象普通的机器一样有明确的内部传动装置,而是,N (2 <= N <= 1050)个齿轮互相作用,每个齿轮都可能驱动着多个齿轮。 FJ记录了对于每个齿轮i,记录了它的3个参数:X_i,Y_i表示齿轮中心的位置坐标(-5000 <= X_i <= 5000; -5000 <= Y_i <= 5000);R_原创 2016-04-20 17:57:13 · 617 阅读 · 0 评论 -
模拟+BFS-BZOJ-1611-[Usaco2008 Feb]Meteor Shower流星雨
Description去年偶们湖南遭受N年不遇到冰冻灾害,现在芙蓉哥哥则听说另一个骇人听闻的消息: 一场流星雨即将袭击整个霸中,由于流星体积过大,它们无法在撞击到地面前燃烧殆尽, 届时将会对它撞到的一切东西造成毁灭性的打击。很自然地,芙蓉哥哥开始担心自己的 安全问题。以霸中至In型男名誉起誓,他一定要在被流星砸到前,到达一个安全的地方 (也就是说,一块不会被任何流星砸到的土地)。如果将霸中放入一个直原创 2016-04-20 17:08:31 · 495 阅读 · 0 评论 -
BFS-BZOJ-1627-[Usaco2007 Dec]穿越泥地
Description清早6:00,Farmer John就离开了他的屋子,开始了他的例行工作:为贝茜挤奶。前一天晚上,整个农场刚经受过一场瓢泼大雨的洗礼,于是不难想见,FJ 现在面对的是一大片泥泞的土地。FJ的屋子在平面坐标(0, 0)的位置,贝茜所在的牛棚则位于坐标(X,Y) (-500 <= X <= 500; -500 <= Y <= 500)处。当然咯, FJ也看到了地上的所有N(1 <=原创 2016-04-26 16:48:26 · 477 阅读 · 0 评论 -
BFS-BZOJ-1603-[Usaco2008 Oct]打谷机
DescriptionFarmer John有一个过时的打谷机(收割小麦),它需要带子来带动。发动机驱动轮1总是顺时针旋转的,用来带动转轮2,转轮2来带动转轮3,等等。一共有n(2<=n<=1000)个转轮(n-1条带子)。上面的图解描述了转轮的两种连接方式,第一种方式使得两个轮子旋转的方向相同,第二种则相反。 给出一串带子的信息: *Si—驱动轮 *Di—被动轮 *Ci—连接的类型(0=直接连接,原创 2016-03-11 17:56:10 · 492 阅读 · 0 评论 -
BFS-BZOJ-1602-[Usaco2008 Oct]牧场行走
DescriptionN头牛(2<=n<=1000)别人被标记为1到n,在同样被标记1到n的n块土地上吃草,第i头牛在第i块牧场吃草。 这n块土地被n-1条边连接。 奶牛可以在边上行走,第i条边连接第Ai,Bi块牧场,第i条边的长度是Li(1<=Li<=10000)。 这些边被安排成任意两头奶牛都可以通过这些边到达的情况,所以说这是一棵树。 这些奶牛是非常喜欢交际的,经常会去互相访问,他们想让你去帮原创 2016-03-10 11:42:44 · 559 阅读 · 0 评论 -
BFS-hihoCoder-第六十六周-Have Lunch Together
Have Lunch Together 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Everyday Littile Hi and Little Ho meet in the school cafeteria to have lunch together. The cafeteria is often so crowded that two adjacen原创 2015-10-08 17:17:09 · 895 阅读 · 0 评论 -
BFS-HDU-2612-Find a Way
Find a wayTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 6615 Accepted Submission(s): 2189Problem Description Pass a year learning in Hang原创 2015-08-17 21:04:03 · 545 阅读 · 0 评论 -
BFS-HDU-1495-非常可乐
非常可乐Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7526 Accepted Submission(s): 3002Problem Description 大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这原创 2015-08-17 20:23:50 · 598 阅读 · 0 评论 -
BFS-UVA-11624-Fire!
Problem : Fire!Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. Help Joe escape the maze.Given Joe’s locat原创 2015-08-17 19:19:22 · 460 阅读 · 0 评论 -
BFS-POJ-3126-Prime Path
Prime Path Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatus Description The ministers of the cabinet were quite upset by the message from the Chief of Secur原创 2015-08-02 16:29:42 · 494 阅读 · 0 评论 -
BFS-POJ-3414-Pots
Pots Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11798 Accepted: 4992 Special Judge DescriptionYou are given two pots, having the volume of A and B liters respectivel原创 2015-08-02 20:51:02 · 509 阅读 · 0 评论 -
BFS-POJ-3278-Catch That Cow
Catch That Cow Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uDescription Farmer John has been informed of the location of a fugitive cow and wants to catch her immediate原创 2015-07-26 19:58:38 · 492 阅读 · 0 评论