描述:要么全选择牛,要么选择一辆车和p-1头牛,那么剩下n+m-p道门可以选择,求选择p道门以后要选择到车的概率
#include <cstdio> int main()
{
//freopen("in.txt","r",stdin);
int m,n,p;
while(scanf("%d%d%d",&m,&n,&p)!=EOF)
{
printf("%.5lf\n",(n*m*1.0+(n-1)*n*1.0)/(m+n)/(m+n-p-1));
}
return 0;
}
相关文章
- Cows(poj 2481 树状数组)
- Lost Cows
- POJ 2837 Til the Cows Come Home
- USACO1.2Milking Cows
- POJ 2186:Popular Cows Tarjan模板题
- K - Popular Cows
- POJ 3275 Ranking the Cows(传递闭包)【bitset优化Floyd】+【领接表优化Floyd】
- POJ3275:Ranking the Cows(Bitset加速floyd求闭包传递)
- 洛谷P2881 [USACO07MAR]排名的牛Ranking the Cows(bitset Floyd)
- 【dfs】BZOJ1703-[Usaco2007 Mar]Ranking the Cows 奶牛排名