codeforces未解决的题目

Ed55 C题 想的基本是正解(不正解在于明明sort就可以 却用了multiset)不明白哪里挂了 对数据也还没改出来

1082C - Multi-Subject Competition

At first, it's optimal to take candidates with maximal levels for a fixed subject.

At second, if we fix number of participants in each subject for some delegation, then it's always optimal to choose all subjects with positive sum of levels.

It leads us to a following solution. Let's divide all candidates by it's si

and sort each group in non-increasing order.

In result we can just iterate over all prefix sums for each group and update global answer of current length with current sum if it has a positive value.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值