CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 数值算法/人工智能 数据结构常用算法

文件名称:jiniunai

  • 所属分类:
  • 标签属性:
  • 上传时间:
    2012-11-16
  • 文件大小:
    172.98kb
  • 已下载:
    0次
  • 提 供 者:
  • 相关连接:
  • 下载说明:
    别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容来自于网络,使用问题请自行百度

背景

三个农民每天清晨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
挤牛奶/Debug/vc60.pdb
挤牛奶/Debug/挤牛奶.exe
挤牛奶/Debug/挤牛奶.ilk
挤牛奶/Debug/挤牛奶.obj
挤牛奶/Debug/挤牛奶.pch
挤牛奶/Debug/挤牛奶.pdb
挤牛奶/Debug/辅导费.obj
挤牛奶/挤牛奶.cpp
挤牛奶/挤牛奶.dsp
挤牛奶/挤牛奶.dsw
挤牛奶/挤牛奶.ncb
挤牛奶/挤牛奶.opt
挤牛奶/挤牛奶.plg
挤牛奶/Debug
挤牛奶

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 搜珍网是交换下载平台,只提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。更多...
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或换浏览器;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com