完全背包:Piggy-Bank猪猪储蓄罐

这道题目是关于完全背包的问题,描述了一个ACM成员使用猪猪储蓄罐存储零钱,但无法得知确切金额,只能通过称重来估计。我们需要找出在已知空猪猪储蓄罐和满猪猪储蓄罐的重量以及各种硬币的面额和重量的情况下,储蓄罐内最少可能含有多少钱。题目提供了一系列的测试案例,包括空猪猪的重量、满猪猪的重量、硬币种类及每种硬币的面额和重量。解决方案需要求解在满足硬币总重量条件下的最小面额总额,如果无法精确达到重量则输出"This is impossible."。
摘要由CSDN通过智能技术生成

完全背包:Piggy-Bank猪猪储蓄罐

Time Limit:1000MS  Memory Limit:65536K
Total Submit:14 Accepted:6

Description

Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. 
ACM要正常运转的前提,准备并提供好一定的财务预算费用是必需的。 

The main income for this action comes from Irreversibly Bound Money (IBM). 
这项活动最主要的收支来自于IBM公司。 

The idea behind is simple. Whenever some ACM member has any small money, he takes all the coins and throws them into a piggy-bank. 
想法很简单,只要ACM成员有一些散钱,他就可以取出所有钱并将其投放到猪猪储蓄罐中。 

You know that this process is irreversible, the coins cannot be removed without breaking the pig. After a sufficiently long time, there should be enough cash in the piggy-bank to pay everything that needs to be paid. 

你要知道的是,这项操作是不可以撤销的,这些硬币投入进去之后是没有打碎猪猪是取不出来的。当充分储备一段较长时间后,在猪猪储蓄罐中可能会有足够多的钱来去付我们需要的费用。 

But there is a big problem with piggy-banks. It is not possible to determine how much money is inside. So we might break the pig into pieces only to find out

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值