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
Codeforces D. TV Shows
最新推荐文章于 2020-12-05 21:22:14 发布
这篇博客讨论了如何在有限的电视资源下,通过合理规划观看电视节目的时间,以最小的成本观看所有节目。给出了输入输出示例及解释,并提出了最优策略的思考。
摘要由CSDN通过智能技术生成