UVA 10886 Standard Deviation
https://vjudge.net/problem/UVA-10886
计算标准差
碰到这种题将式子展开
#include<cmath>
#include<cstdio>
//#include<iostream>
using namespace std;
unsigned long long seed;
long double gen()
{
static const long double Z = ( long double )1.0 / (1LL<<);
seed >>= ;
seed &= ( 1ULL << ) - ;
seed *= seed;
return seed * Z;
}
int main()
{
int T,n;
double xi,xi2,y,x;
scanf("%d",&T);
for(int t=;t<=T;t++)
{
xi=xi2=;
scanf("%d%llu",&n,&seed);
//cin>>n>>seed;
for(int i=;i<=n;i++)
{
y=gen();
xi+=y;
xi2+=y*y;
}
x=xi/n;
printf("Case #%d: %.5lf\n",t,sqrt((xi2-*x*xi+n*x*x)/n));
}
}
UVA 10886 Standard Deviation的更多相关文章
- UVA - 10886 Standard Deviation (标准差)(数论)
题意:下面是一个随机数发生器.输入seed的初始值,你的任务是求出它得到的前n个随机数标准差,保留小数点后5位(1<=n<=10000000,0<=seed<264). 分析: ...
- 标准差(standard deviation)和标准误差(standard error)你能解释清楚吗?
by:ysuncn(欢迎转载,请注明原创信息) 什么是标准差(standard deviation)呢?依据国际标准化组织(ISO)的定义:标准差σ是方差σ2的正平方根:而方差是随机变量期望的二次偏差 ...
- 标准差(standard deviation)和标准错误(standard error)你能解释一下?
by:ysuncn(欢迎转载,转载请注明原始消息) 什么是标准差(standard deviation)呢?依据国际标准化组织(ISO)的定义:标准差σ是方差σ2的正平方根.而方差是随机变量期望的二次 ...
- How to Find the Standard Deviation in Minitab
Standard deviation, represented by the Greek Letter sigma σ, is a measure of dispersement in statist ...
- 方差(variance)、标准差(Standard Deviation)、均方差、均方根值(RMS)、均方误差(MSE)、均方根误差(RMSE)
方差(variance).标准差(Standard Deviation).均方差.均方根值(RMS).均方误差(MSE).均方根误差(RMSE) 2017年10月08日 11:18:54 cqfdcw ...
- Mathematics | Mean, Variance and Standard Deviation
Mean is average of a given set of data. Let us consider below example These eight data points have t ...
- 均方根值(RMS)+ 均方根误差(RMSE)+标准差(Standard Deviation)
均方根值(RMS)+ 均方根误差(RMSE)+标准差(Standard Deviation) 1.均方根值(RMS)也称作为效值,它的计算方法是先平方.再平均.然后开方. 2.均方根误差,它是观测值 ...
- 均方根误差(RMSE),平均绝对误差 (MAE),标准差 (Standard Deviation)
来源:https://blog.csdn.net/capecape/article/details/78623897 RMSE Root Mean Square Error, 均方根误差是观测值与真值 ...
- 标准差(Standard Deviation) 和 标准误差(Standard Error)
本文摘自 Streiner DL.Maintaining standards: differences between the standard deviation and standarderror ...
随机推荐
- 创建、编译、执行 java程序
java源文件(.java)——Java字节码文件(.class)——在java虚拟机上执行 其他语言很多是编译后执行,所以无法跨平台
- OSG学习:多重纹理映射
#include<osgViewer\Viewer> #include<osg\Node> #include<osg\Geode> #include<osg\ ...
- css那些事儿2 盒子模型
盒子模型是网页元素所占据页面窗口的矩形范围,是网页布局的核心基础之一,这里的盒子模型与我们平常收到的包裹类似. 一个包裹从内到外,分为真实物品部分,物品与外壳之间的填充区,外壳的厚度,当多个包裹放置在 ...
- PAT 甲级 1032 Sharing
https://pintia.cn/problem-sets/994805342720868352/problems/994805460652113920 To store English words ...
- union查询
select id, uid, money, FROM_UNIXTIME(created) as created, type FROM ( #type=1是 cjw_finance_bonus ...
- WDCP V3.2面板安装且新增PHP多版本和免费Let's Encrypt SSL证书
文章原文:http://www.itbulu.com/wdcp-v32.html 我们很多网友对于WDCP面板应该算是比较熟悉的,老蒋在博客中也多次分享WDCP面板的相关教程内容,因为在平时帮助网友解 ...
- C跟C++
工作以来几乎就只写C,下周开始的新工作可能就要开始写C++啦~ C: C++: 1.template 2.多态.重载.继承 3.虚函数 C++内存布局 看两张耗子的图片就清楚了.其中虚函数表一般放在数 ...
- MongoDB、ElasticSearch、Redis、HBase这四种热门数据库的优缺点及应用场景
MongoDB MongoDB是当今最火爆的NoSQL数据库.MongoDB最早在09年发布,算得上是早期大数据时代的数据库代表作了.随着MongoDB的火爆,研发MongoDB的团队还专门成立了Mo ...
- 【bzoj2100】[Usaco2010 Dec]Apple Delivery 最短路
题目描述 Bessie has two crisp red apples to deliver to two of her friends in the herd. Of course, she tr ...
- 【bzoj1593】[Usaco2008 Feb]Hotel 旅馆 线段树区间合并
题目描述 奶牛们最近的旅游计划,是到苏必利尔湖畔,享受那里的湖光山色,以及明媚的阳光.作为整个旅游的策划者和负责人,贝茜选择在湖边的一家著名的旅馆住宿.这个巨大的旅馆一共有N (1 <= N & ...