poj 3069 Saruman's Army(贪心)

该博客讨论了如何通过贪心策略解决Saruman带领军队时,确保每个士兵都在palantir的有效范围内,从而确定最小的palantir需求量。输入包含军队的最大有效范围R和士兵数量n,以及士兵的位置。输出是最小的palantir数量。样例展示了不同情况下的解决方案,强调palantir必须由士兵携带,不能独立浮动。
摘要由CSDN通过智能技术生成

Saruman's Army
Time Limit: 1000MS   Memory Limit: 65536K
Total Submissions: 3446   Accepted: 1752

Description

Saruman the White must lead his army along a straight path from Isengard to Helm’s Deep. To keep track of his forces, Saruman distributes seeing stones, known as palantirs, among the troops. Each palantir has a maximum effective range of R units, and must be carried by some troop in the army (i.e., palantirs are not allowed to “free float” in mid-air). Help Saruman take control of Middle Earth by determining the minimum number of

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值