zoukankan      html  css  js  c++  java
  • LightOJ

    Description

    You probably have played the game "Throwing Balls into the Basket". It is a simple game. You have to throw a ball into a basket from a certain distance. One day we (the AIUB ACMMER) were playing the game. But it was slightly different from the main game. In our game we were N people trying to throw balls into identical Baskets. At each turn we all were selecting a basket and trying to throw a ball into it. After the game we saw exactly S balls were successful. Now you will be given the value of and M. For each player probability of throwing a ball into any basket successfully is P. Assume that there are infinitely many balls and the probability of choosing a basket by any player is 1/M. If multiple people choose a common basket and throw their ball, you can assume that their balls will not conflict, and the probability remains same for getting inside a basket. You have to find the expected number of balls entered into the baskets after turns.

    Input

    Input starts with an integer T (≤ 100), denoting the number of test cases.

    Each case starts with a line containing three integers N (1 ≤ N ≤ 16), M (1 ≤ M ≤ 100) and K (0 ≤ K ≤ 100)and a real number P (0  P ≤ 1)P contains at most three places after the decimal point.

    Output

    For each case, print the case number and the expected number of balls. Errors less than 10-6 will be ignored.

    Sample Input

    2

    1 1 1 0.5

    1 1 2 0.5

    Sample Output

    Case 1: 0.5

    Case 2: 1.000000

     题目大意:有N个人,M个篮框,K个回合,每个回合每个人可以投一颗球,每个人的命中率都是相同的P,问K回合后,投中的球的期望数是多少
    这个题目我想高中老师讲过
    答案就是 n*k*p;
    一万个6飘过
  • 相关阅读:
    #JavaScript 闭包问题详解 #打倒心魔
    Typora + cnblog 图片自动上传 (超详细哦)
    #FUNCTION#CALL对象中的函数内作用域问题.md
    #windows #Github #HOST
    #######对象迭代器######
    #为什么不建议使用for...in 去遍历数组
    #前后端附件传输,去重的一种方式#解决方案
    #页面滚动刷新的实现原理 #下拉刷新#上拉刷新#drag to fresh
    自己动手实现一个阻塞队列
    APC注入
  • 原文地址:https://www.cnblogs.com/demodemo/p/4748895.html
Copyright © 2011-2022 走看看