POJ_1456 Supermarket

这是一个关于如何确定超市商品销售顺序以最大化利润的问题。每个商品有利润和销售截止日期,每天只能销售一个商品。需要找到最佳的销售计划,使得总利润最大。输入包含商品数量及其利润和截止日期,输出是最佳销售计划的利润。可以通过使用小根堆,按截止日期排序并比较商品价值来求解。
摘要由CSDN通过智能技术生成

Supermarket

链接

POJ_1456 Supermarket

Description

A supermarket has a set Prod of products on sale. It earns a profit p x p_x px for each product x ∈ P r o d x \in Prod xProd sold by a deadline d x d_x dx that is measured as an integral number of time units starting from the moment the sale begins. Each product takes precisely one unit of time for being sold. A selling schedule is an ordered subset of products S e l l ≤ P r o d Sell \leq Prod SellProd such that the selling of each product x ∈ S e l l x \in Sell xSell, according to the ordering of Sell, completes before the deadline dx or just when dx expires. The profit of the selling schedule is P r o f i t ( S e l l ) = ∑ x ∈ S e l l p x Profit(Sell)=\sum_{x∈Sell} px Profit(Sell)=xSellpx. An optimal selling schedule is a schedule with a maximum profit.

For example, consider the products P r o d = { a , b , c , d } Prod=\left\{a,b,c,d\right\} Prod={ a,b,

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值