描述:

Aggressive cows | JXNUOJhttps://acs.jxnu.edu.cn/problem/POJ2456

Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls.(John农民已经新建了一个长畜棚带有N(2<=N<=100000)个牛棚) The stalls are located along a straight line at positions x1,...,xN (0 <= xi <= 1,000,000,000).(牛棚沿直线排列在x1,...,xN上)

His C (2 <= C <= N) cows don't like this barn layout and become aggressive towards each other once put into a stall.(他的C(2<=C<=N)头牛不喜欢这个畜棚的布局,一旦这些牛被放进隔间,他们变会变的好斗起来) To prevent the cows from hurting each other,(为了防止这些牛互相伤害) FJ want to assign the cows to the stalls,(FJ想要分配这些牛进入牛棚) such that the minimum distance between any two of them is as large as possible.(其中他们之间的最小距离尽可能的大) What is the largest minimum distance?(这个最小距离是多少)

输入:

* Line 1: Two space-separated integers: N and C(第一行:两个中间有空格的整数N和C)

* Lines 2..N+1: Line i+1 contains an integer stall location, xi(第二到N+1行:第i+1行包含一个整数牛棚位置,xi)

输出:

* Line 1: One integer: the largest minimum distance(一行:一个整数:最大的最小距离)

注释:

OUTPUT DETAILS:(输出解释)

FJ can put his 3 cows in the stalls at positions 1, 4 and 8, resulting in a minimum distance of 3.(FJ能够把他的三头奶牛放在1,4,8的位置上,导致最小距离为3)

Huge input data,scanf is recommended.(数据量较大,推荐使用scanf)

Aggressive cows题目翻译相关推荐

  1. Aggressive cows POJ - 2456

    2456 -- Aggressive cows 题目大意:有c只牛,要把他们放在n个屋子里,每个屋子放一只牛,每个屋子都在一根数轴上,给出他们的坐标,要让每个屋子间的最小距离尽可能的大,问这个最大距离 ...

  2. 二分入门——poj 2456 aggressive cows

    这是一道二分的神奇贪心题,先上题目 Aggressive cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11714 A ...

  3. 二分搜索 POJ 2456 Aggressive cows

    题目传送门 1 /* 2 二分搜索:搜索安排最近牛的距离不小于d 3 */ 4 #include <cstdio> 5 #include <algorithm> 6 #incl ...

  4. Aggressive cows POJ2456

    Aggressive cows(愤怒的牛)(分治) Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 40455 Accepted: ...

  5. POJ 2456 Aggressive cows(二分答案)

    Aggressive cows Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22674 Accepted: 10636 Des ...

  6. BZOJ 1734: [Usaco2005 feb]Aggressive cows 愤怒的牛( 二分答案 )

    最小最大...又是经典的二分答案做法.. -------------------------------------------------------------------------- #inc ...

  7. POJ 2456 - Aggressive cows(二分)

    Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stal ...

  8. Aggressive cows(c语言)

    题目描述 Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are ...

  9. poj 2456 Aggressive cows 【二分+最大化最小值】

    题目链接:http://poj.org/problem?id=2456 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 210 ...

  10. 2022 美国数学建模比赛 题目 翻译

    MCM A题:自行车骑手的功率曲线 B题:水和水电的共享 C题:交易策略 请注意题目的时间翻译有误,请参考原文的时间描述. ICM D题:数据瘫痪?使用我们的分析! 乱码部分中文为:一封给ICM公司客 ...

最新文章

  1. java script valueof_Javascript new Date().valueOf()的作用与时间戳由来详解
  2. 循环更新数据库java_java – 无限循环数据库检查
  3. WEB前端学习笔记01利用纯CSS书写二级水平导航菜单
  4. java aix 移植linux,[转]程序的可移植性:window,linux,aix,solaris下程序移植体会
  5. Shell(11)——awk(1)
  6. 一个简单的完成端口(服务端/客户端)类
  7. 实践证明,SQL Server 2000 + 2005 + 2008,完全可以共存
  8. python设计小游戏谁先走到17_蜗牛绕墙爬(python小游戏源码)
  9. 通过C#中的在线文件自动更新应用程序
  10. halcon窗体的移动和缩放_Halcon hWindowControl 鼠标缩放平移区域模板匹配绘制
  11. 222.完全二叉树的节点个数
  12. oracle报表工具查询数据太慢优化方案,页面优化和sql优化
  13. 光立方体c语言程序,444光立方程序怎么写 光立方原理图、源代码及制作教程
  14. pdf文件如何生成目录 wps_如何使用WPS把Word文档转换为PDF文档并生成目录?
  15. U校园大学生必备答案
  16. 复选框的对勾颜色怎么改
  17. IEEE ICCSE 2022 Call for Papers (征文公告)
  18. 南京大学软件学院 西交计算机,2021届薪酬最高的十大本科专业,前三名都是计算机和相关专业...
  19. 记一次没有引用Base64的maven依赖引起的血案
  20. ZOJ3587 Marlon's String

热门文章

  1. VC 获取汉字拼音首字母(unicode编码)上
  2. 杭州银行2018信息科技部面试
  3. 解决Invalid bound statement (not found): com.hengjun.mapper.UserMapper.selectByExample,
  4. java解析project mpp文件_Java利用mpxj解析mpp格式文件
  5. 绞尽脑汁!益智解谜的Mac游戏推荐
  6. iOS 隐藏百度地图SDK的百度LOGO
  7. Excel用SQL合并多个工作表
  8. 寻找反素数python
  9. CDN月95计费方式
  10. wingdings字体符号在哪_Wingdings特殊字符及符號對照表 | 學步園