uva 11157 - Dynamic Frog (二分 + 最大流)

题目描述了一只名为Fred的青蛙需要跳过河中不同大小的石头到达对岸并返回,小石头只能承受一次重量,大石头可以多次使用。目标是最小化青蛙的最大跳跃距离。输入包含测试用例数量T和每个案例的石头信息,包括石头类型(大或小)和位置。输出每个案例中最小化的最大跳跃距离。解题方法可以使用最大流算法。
摘要由CSDN通过智能技术生成

D

Next Generation Contest 3

Time Limit: 2 seconds

Dynamic Frog

 

With the increased use of pesticides, the local streams and rivers have become so contaminated that it has become almost impossible for the aquatic animals to survive.

Frog Fred is on the left bank of such a river. N rocks are arranged in a straight line from the left bank to the right bank. The distance between the left and the right bank is D meters. There are rocks of two sizes. The bigger ones can withstand any weight but the smaller ones start to drown as soon as any mass is placed on it. Fred has to go to the right bank where he has to collect a gift and return to the left bank where his home is situated.

He can land on every small rock at most one time, but can use the bigger ones as many times as he likes. H

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值