# SGU 495 Kids and Prizes (概率DP入门)

#include<cstdio>
#include<iostream>

using namespace std;
const int maxm = 100005;

double dp[maxm];
int n,m;

int main(){
scanf("%d%d",&n,&m);
dp[0] = 0;
for(int i=1;i<=m;i++){
dp[i] = dp[i-1]*dp[i-1]/n + (dp[i-1]+1)*(n-dp[i-1])/n;
}
printf("%.9f\n",dp[m]);
return 0;
}


• 本文已收录于以下专栏：

## SGU 495 Kids and Prizes （概率DP）

Copied from kuangbin 495. Kids and Prizes Time limit per test: 0.5 second(s) Memory limit: ...

## [ACM] SGU 495 Kids and Prizes (概率，期望，二项分布）

495. Kids and Prizes Time limit per test: 0.25 second(s) Memory limit: 262144 kilobytes inp...

## SGU 495 Kids and Prizes（期望DP || 数学规律）

Kids and Prizes Description ICPC (International Cardboard Producing Company) is in the bus...

## SGU 495 Kids and Prizes [期望]

ICPC (International Cardboard Producing Company) is in the business of producing cardboard boxes. —...

## Kids and Prizes(概率+期望)

http://acm.sdut.edu.cn:8080/vjudge/contest/view.action?cid=113#problem/K 概率又还给老师了。。。 有n个奖品放在n个盒子里，...

## 概率dp sgu495

Kids and Prizes Time Limit:250MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit ...

## Kids and Prizes 来源： <http://acm.hust.edu.cn/vjudge/contest/view.action?cid=85996#problem/B>

B - Kids and Prizes Time Limit:250MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u ...

## Codeforces Round #384(Div. 2)D. Chloe and pleasant prizes【树形dp】

D. Chloe and pleasant prizes time limit per test 2 seconds memory limit per test 256 megabyt...

## codeforces 743D Chloe and pleasant prizes (DFS/树形DP)

D. Chloe and pleasant prizes 传送门：http://codeforces.com/contest/743/problem/D Generous sponsors of th...
• wchhlbt
• 2016年12月17日 22:11
• 222

举报原因： 您举报文章：SGU 495 Kids and Prizes (概率DP入门) 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)