[概率DP] Codeforces 453A Little Pony and Expected Maximum
来源:互联网 发布:网络借贷平台排名 编辑:程序博客网 时间:2024/06/06 07:20
比较简单的概率题
f(k)=(k/n)^m-f(k-1)
#include<cstdio> #include<cstdlib>#include<algorithm> using namespace std; int n,m; inline double Pow(double a,int b){ double ret=1; for (;b;b>>=1,a*=a) if (b&1) ret*=a; return ret;} int main(){ scanf("%d%d",&n,&m); double ans=0,last=0; for (int k=1;k<=n;k++){ double t=(double)k/n; t=Pow(t,m); ans+=(t-last)*k; last=t; } printf("%.6lf\n",ans); return 0; }
0 0
- [概率DP] Codeforces 453A Little Pony and Expected Maximum
- Codeforces 453A Little Pony and Expected Maximum 概率期望
- Codeforces 453A Little Pony and Expected Maximum 概率题Orz
- 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 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
- Codeforces 453 A. Little Pony and Expected Maximum
- Little Pony and Expected Maximum CodeForces
- A. Little Pony and Expected Maximum
- binlog,redo log,undo log区别
- poj 1006 Biorhythms(中国剩余定理)
- 百度CTF
- 使用react-native,reduce开发简洁且的上拉刷新下拉加载更多的组件
- 去掉字符串最后一个字符
- [概率DP] Codeforces 453A Little Pony and Expected Maximum
- TreeMap源码解析
- 用80/20法则迅速拓展程序员学习的广度
- 矩阵乘法(POJ 3233 Matrix Power Series )
- 新手上路,对java的肤浅理解,探讨交流
- linux下ip冲突检测
- Oracle基本语法&&函数&&子查询&&分页查询&&排序&&集合操作&&高级分组函数
- 栈(stack )数据结构
- 第四天