Codeforces 453A Little Pony and Expected Maximum
来源:互联网 发布:淘宝真正的外贸店 编辑:程序博客网 时间:2024/06/11 19:43
题目链接
题意:有个有m面的均匀骰子,每个面的数分别是1到m。现在扔n次,求最大值的期望。
思路:n次实验中最大值为x的概率
int main(int argc, const char * argv[]){ // freopen("in.txt","r",stdin); // freopen("out.txt","w",stdout); int n, m; scanf("%d%d", &m,&n); double ans = 0.0; for (int i = 1;i <= m;++i) { ans += (pow(1.0*i/m, n) - pow(1.0*(i-1)/m, n))*i; } printf("%.12lf\n", ans); return 0;}
0 0
- Codeforces 453A Little Pony and Expected Maximum
- Codeforces 453A. Little Pony and Expected Maximum
- Codeforces 453 A. Little Pony and Expected Maximum
- Codeforces 453A Little Pony and Expected Maximum(期望)
- codeforces 453A Little Pony and Expected Maximum 最大值期望
- Codeforces 453A Little Pony and Expected Maximum 概率期望
- codeforces 453-A Little Pony and Expected Maximum
- codeforces 453A Little Pony and Expected Maximum(期望)
- 【codeforces】 453A Little Pony and Expected Maximum
- Codeforces 453A Little Pony and Expected Maximum
- Codeforces 453A Little Pony and Expected Maximum
- CodeForces 453A Little Pony and Expected Maximum
- [概率DP] Codeforces 453A Little Pony and Expected Maximum
- Codeforces 453 A. Little Pony and Expected Maximum
- Little Pony and Expected Maximum CodeForces
- A. Little Pony and Expected Maximum
- A. Little Pony and Expected Maximum
- Codeforces 453A Little Pony and Expected Maximum 概率题Orz
- C++与Java中类访问权限的差异
- linux中安装oracle11g
- Servlet学习(三)Servlet编程实例-网站登录(修改版-增加数据库-附源码)
- 求a和b 的和
- 用java解leetcode上easy题5
- Codeforces 453A Little Pony and Expected Maximum
- 怎样在一台机器的listener.ora中配置多个listener
- (GeekBand或极客班)对象的生命周期小实验。
- cf#204-div1 -D - Jeff and Removing Periods-莫队算法-维护等差数列
- java中volatile关键字的含义
- 【平衡树】Treap
- 【知识积累】使用Navicat连接Oracle数据库遇到的问题
- 手机性能标准分类表
- Ubuntu 上 HUSTOJ Pascal判题设置