文件名称:jiniunai
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 173kb
- 下载次数:
- 0次
- 提 供 者:
- bangban*******
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
背景
三个农民每天清晨5点起床,然后去牛棚给3头牛挤奶。第一个农民在300时刻(从5点开始计时,秒为单位)给他的牛挤奶,一直到1000时刻。第二个农民在700时刻开始,在 1200时刻结束。第三个农民在1500时刻开始2100时刻结束。期间最长的至少有一个农民在挤奶的连续时间为900秒(从300时刻到1200时刻),而最长的无人挤奶的连续时间(从挤奶开始一直到挤奶结束)为300秒(从1200时刻到1500时刻)。
你的任务是编一个程序,读入一个有N个农民(1 <= N <= 5000)挤N头牛的工作时间列表,计算以下两点(均以秒为单位):
• 最长至少有一人在挤奶的时间段。
• 最长的无人挤奶的时间段。
输入
第1行: 一个整数N
第22..N+1行: 每行两个小于1000000的非负整数,表示一个农民的开始时刻与结束时刻。
输出
对应输入,输出上述两个需要求的值。-Background
Three farmers get up at 5 every morning, then go to 3 cow milking barn. The first farmers in the 300 time (from 5:00 start time, seconds) to his milking cows until 1000 moment. The second moment of farmers in the 700, the end time in 1200. The third moment of 2100 farmers in the moment of the end of 1500. The longest period of at least one continuous-time farmers milking 900 seconds (time from 300 to 1200 times), and the longest continuous time no one milking (milking from the beginning to the end of milking) 300 seconds (time from 1200 to 1500 time).
Your task is to compile a program, there are N read a farmer (1 <= N <= 5000) N cattle crowded list of working hours, calculate the following two points (both seconds):
• At least one person up to the time period in milking.
• No milking the longest period of time.
Enter
Line 1: an integer N
No. 22 .. N 1 lines: each line is less than one million two non-negative integer, indicating the start
三个农民每天清晨5点起床,然后去牛棚给3头牛挤奶。第一个农民在300时刻(从5点开始计时,秒为单位)给他的牛挤奶,一直到1000时刻。第二个农民在700时刻开始,在 1200时刻结束。第三个农民在1500时刻开始2100时刻结束。期间最长的至少有一个农民在挤奶的连续时间为900秒(从300时刻到1200时刻),而最长的无人挤奶的连续时间(从挤奶开始一直到挤奶结束)为300秒(从1200时刻到1500时刻)。
你的任务是编一个程序,读入一个有N个农民(1 <= N <= 5000)挤N头牛的工作时间列表,计算以下两点(均以秒为单位):
• 最长至少有一人在挤奶的时间段。
• 最长的无人挤奶的时间段。
输入
第1行: 一个整数N
第22..N+1行: 每行两个小于1000000的非负整数,表示一个农民的开始时刻与结束时刻。
输出
对应输入,输出上述两个需要求的值。-Background
Three farmers get up at 5 every morning, then go to 3 cow milking barn. The first farmers in the 300 time (from 5:00 start time, seconds) to his milking cows until 1000 moment. The second moment of farmers in the 700, the end time in 1200. The third moment of 2100 farmers in the moment of the end of 1500. The longest period of at least one continuous-time farmers milking 900 seconds (time from 300 to 1200 times), and the longest continuous time no one milking (milking from the beginning to the end of milking) 300 seconds (time from 1200 to 1500 time).
Your task is to compile a program, there are N read a farmer (1 <= N <= 5000) N cattle crowded list of working hours, calculate the following two points (both seconds):
• At least one person up to the time period in milking.
• No milking the longest period of time.
Enter
Line 1: an integer N
No. 22 .. N 1 lines: each line is less than one million two non-negative integer, indicating the start
(系统自动生成,下载前可以参看下载内容)
下载文件列表
挤牛奶\Debug\vc60.idb
......\.....\vc60.pdb
......\.....\挤牛奶.exe
......\.....\挤牛奶.ilk
......\.....\挤牛奶.obj
......\.....\挤牛奶.pch
......\.....\挤牛奶.pdb
......\.....\辅导费.obj
......\挤牛奶.cpp
......\挤牛奶.dsp
......\挤牛奶.dsw
......\挤牛奶.ncb
......\挤牛奶.opt
......\挤牛奶.plg
......\Debug
挤牛奶
......\.....\vc60.pdb
......\.....\挤牛奶.exe
......\.....\挤牛奶.ilk
......\.....\挤牛奶.obj
......\.....\挤牛奶.pch
......\.....\挤牛奶.pdb
......\.....\辅导费.obj
......\挤牛奶.cpp
......\挤牛奶.dsp
......\挤牛奶.dsw
......\挤牛奶.ncb
......\挤牛奶.opt
......\挤牛奶.plg
......\Debug
挤牛奶