SGU 495. Kids and Prizes 期望
2014-10-02 13:29
381 查看
n个盒子 m个人轮流选 拿走盒子里的奖品 盒子再放回去 求得到奖品的期望
可以求没有被选到的奖品的期望 用n减去就是答案
可以求没有被选到的奖品的期望 用n减去就是答案
#include <stdio.h> #include <iostream> #include <algorithm> #include <math.h> using namespace std; int main() { int n,m; while(scanf("%d%d",&n,&m)!=EOF) { double p=(double)(n-1)/n; double ans=n-n*pow(p,m); printf("%.10lf\n", ans); } return 0; }
相关文章推荐
- sgu 495. Kids and Prizes (简单概率dp 正推求期望)
- SGU 495. Kids and Prizes( 数学期望 )
- SGU 495 Kids and Prizes(期望)
- SGU 495. Kids and Prizes(概率dp)
- SGU 495. Kids and Prizes
- SGU 495 Kids and Prizes(期望)
- SGU 495 Kids and Prizes(期望DP || 数学规律)
- 【SGU】495. Kids and Prizes
- SGU 495: Kids and Prizes
- 495. Kids and Prizes
- SGU 495 Kids and prizes(概率题,二项分布)
- SGU-495 Kids and Prizes(概率DP)
- Kids and Prizes(SGU 495)
- SGU 495 Kids and Prizes [期望]
- SSU 495. Kids and Prizes(概率DP)
- Kids and Prizes(概率+期望)
- Kids and Prizes(数学求期望)
- 解题报告:SGU - 495 Kids and Prizes 期望概率
- SGU 495 Kids and Prizes(概率dp)
- SGU 495 Kids and Prizes (概率期望DP)