武大校赛资格赛 求方差
发布日期:2021-10-08 15:48:48
浏览次数:3
分类:技术文章
本文共 1915 字,大约阅读时间需要 6 分钟。
Problem 1570 - G - April disease
Time Limit: 1000MS Memory Limit: 65536KB Total Submit: 210 Accepted: 105 Special Judge: No
Description
Holding a contest is an interesting mission, and apparently arranging the problems is not exceptional, either.
You may consider that there are N problems prepared, and it's required to choose M problems to form the problem set of the upcoming contest.
What's more, the evaluating function of all the problems choosed is as follows:
Where Xi represents the hardness of the i_th problem and X represents the average of the M problems.
However, the contest principal Alice has lost himself in April disease, and just wants to hold the worst contest ever.(Sounds horrible...)
Now he wonders, what's the minimum value of s^2 can be.
Input
The first line of each test case contains two numbers N and M. ( 1 <= M <= N <= 30 ) The following line will contain N numbers Xi. ( 1 <= Xi <= 10^9 )
Output
For each test case, output your answer in one line. (Please keep three decimal places.)
Sample Input
4 3 6 10 1 2 5 2 1 8 3 4 9
Sample Output
4.667 0.250
#include#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include
转载地址:https://blog.csdn.net/ONE_PIECE_HMH/article/details/45131395 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
哈哈,博客排版真的漂亮呢~
[***.90.31.176]2024年03月19日 12时27分06秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
python启动远端 exe_python打包exe开机自动启动的实例(windows)
2019-04-21
java当前路径_java获取当前路径的几种方法
2019-04-21
java web传递参数_Javaweb的八种传值方式
2019-04-21
java gui支持的包有哪两个_Java GUI
2019-04-21
java list详解_java集合List解析
2019-04-21
java坐标代码_java实现计算地理坐标之间的距离
2019-04-21
mysql 取两个时间差 php_在php和MySql中计算时间差的方法详解
2019-04-21
mysql 重启数据库实例_mysql 单机多实例重启数据库服务
2019-04-21
dtc mysql_DTCC归来-高可用可扩展数据库架构探讨
2019-04-21
java怎样将日期本土化_Java中的日期操作
2019-04-21
java生产者消费者模型到精通_java生产者消费者模型
2019-04-21
python函数代码块以什么开头_Python初体验-开篇 代码全析
2019-04-21
java闹钟程序设计_JAVA课程设计_闹钟的设计与实现项目-报告_附源代码.doc
2019-04-21
php读取大文件某行内容,PHP读取和修改大文件的某行内容_PHP教程
2019-04-21
打印php错误日志,php怎样打印错误日志
2019-04-21