Aggressive cows题目翻译

描述:

Aggressive cows | JXNUOJicon-default.png?t=LBL2https://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)


版权声明:本文为yhnxzw原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。