Codeforces D. TV Shows

这篇博客讨论了如何在有限的电视资源下,通过合理规划观看电视节目的时间,以最小的成本观看所有节目。给出了输入输出示例及解释,并提出了最优策略的思考。
摘要由CSDN通过智能技术生成

D. TV Shows

time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

There are nn TV shows you want to watch. Suppose the whole time is split into equal parts called "minutes". The ii-th of the shows is going from lili-th to riri-th minute, both ends inclusive.

You need a TV to watch a TV show and you can't watch two TV shows which air at the same time on the same TV, so it is possible you will need multiple TVs in some minutes. For example, if segments [li,ri][li,ri] and [lj,rj][lj,rj] intersect, then shows ii and jj can't be watched simultaneously on one TV.

Once you start watching a show on some TV it is not possible to "move" it to another TV (since it would be too distracting), or to watch another show on the same TV until this show ends.

There is a TV Rental shop near you. It rent

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值