http://acm.hdu.edu.cn/showproblem.php?pid=4004
Problem Description
The annual Games in frogs' kingdom started again. The most famous game is the Ironfrog Triathlon. One test in the Ironfrog Triathlon is jumping. This project requires the frog athletes to jump over the river. The width of the river is L (1<= L <= 1000000000).
There are n (0<= n <= 500000) stones lined up in a straight line from one side to the other side of the river. The frogs can only jump through the river, but they can land on the stones. If they fall into the river, they
are out. The frogs was asked to jump at most m (1<= m <= n+1) times. Now the frogs want to know if they want to jump across the river, at least what ability should they have. (That is the frog's longest jump distance).
Input
The input contains several cases. The first line of each case contains three positive integer L, n, and m.
Then n lines follow. Each stands for the distance from the starting banks to the nth stone, two stone appear in one place is impossible.
Output
For each case, output a integer standing for the frog's ability at least they should have.
Sample Input
6 1 2
2
25 3 3
11
2
18
Sample Output
4
11
思路:最大值最小化,二分+贪心,这道题很是让我纠结。。。。。。。
代码二:
分享到:
相关推荐
The 36th ACM/ICPC Asia Regional Shanghai Site —— Online Contest Problem Set
The 36th ACM/ICPC Asia Regional Dalian Site —— Online Contest 注意,解压密码是:3.1415926535897932384
THE 30th ACM/ICPC ASIA REGIONAL 2005 HANGZHOU SITE Onsite Contest Session 8:30am – 13:30pm, November 20th 2005 (GMT+8) <br>知道是什么了吧。。。
ACM/ICPC参赛者必备!模版库,数十页的C++代码,涵盖ACM/ICPC中出现的各种算法!此为吉林大学版,内容相对比较全,排版质量是各校的模板中最好的!
IOI/ACM/ICPC参赛人员的理想选择——《算法艺术与信息学竞赛》
acm/icpc 课件 贪心 递归 图论 最大矩阵乘积 acm/icpc 课件 贪心 递归 图论 最大矩阵乘积 acm/icpc 课件 贪心 递归 图论 最大矩阵乘积 acm/icpc 课件 贪心 递归 图论 最大矩阵乘积 acm/icpc 课件 贪心 递归 图论 ...
ACM/ICPC大赛
ACM/ICPC中国*辽宁第二届大学生程序设计竞赛题目
搜索
acm/icpc算法集合。acm/icpc算法集合。acm/icpc算法集合。
2015-2016 ACM-ICPC Northeastern European Regional Contest 标程
ACM/ICPC World Finals 1990 task
ACM/ICPC2009 拉丁美洲区域赛 包含输入输出数据 题目PDF文档 详细解题报告+答案代码TXT文档 有一半是水题,2、3个比较难的 大家可以拿来做做 其中的输入输出数据,可以放到那个离线OJ系统去判断你的程序对错。(离线...
ACM/ICPC的教学与实践
动态规划——北京大学暑期课《ACM/ICPC竞赛训练》
浙江师范大学 ACM/ICPC 集训队――算法设计入门学习资料浙江师范大学 ACM/ICPC 集训队――算法设计入门学习资料
2010年ACM/ICPC珠海区域赛决赛题目
ACM/icpc的练习题目分类,非常全面的关于poj题目的分类
ACM/ICPC模板 内容大概有这些 其他 --高精度模板 --RMQ --改点堆优化的dijkstra算法 --快速付利叶变换 --稳定婚姻问题 --SPFA(最短路快速算法) // thanks to love8909 几何相关 --初等几何学 --多边形几何 --...
本代码包括了常见的ACM算法,并给出了详细地实现过程,并附上了ACM/ICPC 竞赛之STL。