#BZOJ2428. 均分数据
均分数据
No submission language available for this problem.
题目描述
已知N个正整数:A1、A2、……、An 。今要将它们分成M组,使得各组数据的数值和最平均,即各组的均方差最小。均方差公式如下:
, mso-hansi-font-family:"Times New Roman"">其中
宋体">σ</span><span style="font-family:宋体;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman"">为均方差,</span><span style="font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"">是各组数据和的平均值,</span>xi<span style="font-family:宋体;mso-ascii-font-family:
"Times New Roman";mso-hansi-font-family:"Times New Roman"">为第</span>i<span style="font-family:宋体;mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman"">组数据的数值和。</span>
</p>
输入格式
输出格式
</p>6 3
1 2 3 4 5 6
0.00
数据范围与约定
对于全部的数据,保证有K<=N <= 20,2<=K<=6