P2255 [USACO14JAN]记录奥林比克Recording the M…

    • 495通过
    • 1K提交
  • 题目提供者 FarmerJohn2
  • 评测方式 云端评测
  • 标签 动态规划,动规,dp 排序 贪心 USACO 2014
  • 难度 普及+/提高
  • 时空限制 1000ms / 128MB

题解

  • 提示:收藏到任务计划后,可在首页查看。
  • 体验新版界面

    最新讨论 显示

    推荐的相关题目 显示

    题目描述

    Being a fan of all cold-weather sports (especially those involving cows),Farmer John wants to record as much of the upcoming winter Moolympics as possible.

    The television schedule for the Moolympics consists of N different programs(1 <= N <= 150), each with a designated starting time and ending time. FJ has a dual-tuner recorder that can record two programs simultaneously.

    Please help him determine the maximum number of programs he can record in total.

    农民约翰热衷于所有寒冷天气的运动(尤其是涉及到牛的运动), 农民约翰想录下尽可能多的电视节目。 为moolympics电视时间表由N个不同的节目 (1 < = n=150),每个具有指定的开始时间和结束时间。FJ 有一个双调谐器录音机,可以同时录制两个节目。 请帮助他确定他能录制的节目的最大数量。

    输入输出格式

    输入格式:

    * Line 1: The integer N.

    * Lines 2..1+N: Each line contains the start and end time of a single program (integers in the range 0..1,000,000,000).

    第1行:整数n。 第2行.. 1 + n:每行包含单个的开始和结束时间 程序(范围为0…1000000000的整数)。

    输出格式:

    * Line 1: The maximum number of programs FJ can record.

    仅一行,节目FJ可以记录的最大数量。

    输入输出样例

    输入样例#1: 复制
    6
    0 3
    6 7
    3 10
    1 5
    2 8
    1 9
    输出样例#1: 复制
    4

    说明

    INPUT DETAILS:

    The Moolympics broadcast consists of 6 programs. The first runs from time 0 to time 3, and so on.

    OUTPUT DETAILS:

    FJ can record at most 4 programs. For example, he can record programs 1 and 3 back-to-back on the first tuner, and programs 2 and 4 on the second tuner.

    Source: USACO 2014 January Contest, Silver

    提示
    标程仅供做题后或实在无思路时参考。
    请自觉、自律地使用该功能并请对自己的学习负责。
    如果发现恶意抄袭标程,将按照I类违反进行处理。