題目:有m+n個們,每個門後面有牛或者車;有n仅仅牛,m輛車,你選擇当中1個;

然後打開当中的k你沒有選中的門後是牛的,問你改變選時得到車的概率。

說明:數學題,概率。全概率公式就可以:

說明:第1001了O(∩_∩)O~

#include <stdio.h> 

int main()
{
int cow,car,show;
while (~scanf("%d%d%d",&cow,&car,&show))
printf("%.5lf\n",(cow+car-1.0)*car/(cow+car)/(cow+car-show-1.0));
return 0;
}

UVa 10491 - Cows and Cars的更多相关文章

  1. UVa 10491 Cows and Cars (概率&广义三门问题 )

    10491 - Cows and Cars Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onli ...

  2. UVa 10491 - Cows and Cars(全概率)

    链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  3. UVA 10491 Cows and Cars (全概率公式)

    #include<bits/stdc++.h> #include<stdio.h> #include<iostream> #include<cmath> ...

  4. 10491 - Cows and Cars

    描述:要么全选择牛,要么选择一辆车和p-1头牛,那么剩下n+m-p道门可以选择,求选择p道门以后要选择到车的概率 #include <cstdio> int main() { //freo ...

  5. UVA10491 - Cows and Cars(概率)

    UVA10491 - Cows and Cars(概率) 题目链接 题目大意:给你n个门后面藏着牛.m个门后面藏着车,然后再给你k个提示.在你作出选择后告诉你有多少个门后面是有牛的,如今问你作出决定后 ...

  6. Cows and Cars UVA - 10491 (古典概率)

    按照题目的去推就好了 两种情况 1.第一次选择奶牛的门  概率是 a/(a+b) 打开c扇门后  除去选择的门 还剩 a-1-c+b扇门  则选到车的概率为b/(a-1-c+b) 2.第一次选择车的门 ...

  7. uva 10491

    https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  8. UVa 10491 奶牛和轿车(全概率公式)

    https://vjudge.net/problem/UVA-10491 题意: 假设有a头牛,b辆车,在最终选择前主持人会替你打开c个有牛的门,输出"总是换门"的策略下,赢得车的 ...

  9. UVa10491 Cows and Cars

    #include<iostream> #include<cstdio> #include<algorithm> int main(){ double a,b,c; ...

随机推荐

  1. UVA 12263 Rankings(拓扑排序)

    给出一个n个数的序列1,然后有m个改动(a, b),在序列2中a跟b在序列中的相对顺序改变.求符合题意的序列2. 题中说道如果一个数的位置不确定,则输出‘?' ,仔细想想,这种情况是不会存在的,因为在 ...

  2. C#获取设备的IP和Mac类

    /// <summary> /// 此类用于获得设备的Ip和Mac /// </summary> public class Mac { [DllImport("Iph ...

  3. Acquire and Release Semantics

    An operation has acquire semantics if other processors will always see its effect before any subsequ ...

  4. 上市ASCII 表省内发现!

    表格来自,这里 扩展码表:

  5. Shine we together: A innovative dating site using 2012 Nobel Laureate Roth's algorithm

    Abstract Our dating site introduced scoring and its related functionalities innovatively, conforming ...

  6. Java中动态代理技术生成的类与原始类的区别 (转)

    用动态代理的时候,对它新生成的类长什么样子感到好奇.有幸通过一些资料消除了心里的疑惑. 平时工作使用的Spring框架里面有一个AOP(面向切面)的机制,只知道它是把类重新生成了一遍,在切面上加上了后 ...

  7. poj1185炮兵阵地

    #include <iostream> #include <cstdio> #include <cmath> #include <algorithm> ...

  8. MySQL 存储过程和函数(转)

    概述 一提到存储过程可能就会引出另一个话题就是存储过程的优缺点,这里也不做讨论,一般别人问我我就这样回答你觉得它好你就用它.因为mysql中存储过程和函数的语法非常接近所以就放在一起,主要区别就是函数 ...

  9. Java EE (3) -- Java EE 6 Web Services Developer Certified Expert(1z0-897)

    Create an SOAP web service in a servlet container Create a RESTful web service in a servlet containe ...

  10. C++ 建设者继承

    微通道公用号CodingRush 分享编程.算法.机器人leanring.数据挖掘.推荐系统.知识大数据计算框架,欢迎扫码关注. 子类继承了哪些东西? 子类在继承父类的时候,父类的public成员变量 ...