USACO 2019年3月份第一题 解答

博客详细解答了USACO 2019年3月份竞赛的第一道题目,内容涉及在10x10网格中规划从湖泊到谷仓的最短'桶brigade'路径,以扑灭火灾。题目要求确定占用最少空格的奶牛数量来形成有效的传递水桶的队伍。博客提供了输入输出格式,并给出了一种可能的7头奶牛的解决方案,同时指出该问题可以使用广度优先搜索(BFS)策略来解决。
摘要由CSDN通过智能技术生成

USACO 2019年3月份第一题 解答

题目:题目

A fire has broken out on the farm, and the cows are rushing to try and put it out!

The farm is described by a 10×10

grid of characters like this:




…B…

…R…


…L…

The character ‘B’ represents the barn, which has just caught on fire. The ‘L’ character represents a lake, and ‘R’ represents the location of a large rock.

The cows want to form a “bucket brigade” by placing themselves along a path between the lake and the barn so that they can pass buckets of water along the path to help extinguish the fire. A bucket can move between cows if they are immediately adjacent in the north, south, east, or west directions. The same is true for a cow next to the lake — the cow can only extract a bucket of water from the lake if she is immediately adjacent to the lake. Similarly, a cow can only throw a bucket of water

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值