编程介的小学生 2017-03-02 08:00 采纳率: 20.5%
浏览 897
已采纳

The Team of ACM/ICPC

问题描述 :

There are 3 people in a team of ACM/ICPC. Every member of the team will occasionally make some mistakes in the contest. So Mr.F tests every one and everybody gets a Mistake Value x. If the Mistake Values of the 3 members of a team are respectively a, b, c, then the Mistake Value of the team is m = min{ |a-b|, |b-c|, |c-a| }.
Your job is to find the best plan to minimize M which is the sum of all the Mistake Value of teams.
输入:

In the first line, there are two integers N and K. N is the number of people who will make teams and K is the number of teams which is supposed to make. (3<= N <=100000) (0<= k <= N/3 )
There are N lines followed. Each line has an integer D, which is the Mistake Value of the person.(0<=D<=1000000000)
输出:

In the first line, there are two integers N and K. N is the number of people who will make teams and K is the number of teams which is supposed to make. (3<= N <=100000) (0<= k <= N/3 )
There are N lines followed. Each line has an integer D, which is the Mistake Value of the person.(0<=D<=1000000000)
样例输入:

7 2
1
5
3
2
4
7
9
样例输出:

2

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-03-07 15:05
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题