SP1026 FAVDICE - Favorite Dice

    • 136通过
    • 188提交
  • 题目来源 SPOJ 1026
  • 评测方式 RemoteJudge
  • 标签 期望
  • 难度 提高+/省选-
  • 时空限制 391ms / 1536MB

题解

  • 提示:收藏到任务计划后,可在首页查看。
  • 最新讨论 显示

    推荐的相关题目 显示

    题意翻译

    一个n面的骰子,求期望掷几次能使得每一面都被掷到。

    题目描述

    BuggyD loves to carry his favorite die around. Perhaps you wonder why it's his favorite? Well, his die is magical and can be transformed into an N-sided unbiased die with the push of a button. Now BuggyD wants to learn more about his die, so he raises a question:

    What is the expected number of throws of his die while it has N sides so that each number is rolled at least once?

    输入输出格式

    输入格式:

    The first line of the input contains an integer t, the number of test cases. t test cases follow.

    Each test case consists of a single line containing a single integer N (1 <= N <= 1000) - the number of sides on BuggyD's die.

    输出格式:

    For each test case, print one line containing the expected number of times BuggyD needs to throw his N-sided die so that each number appears at least once. The expected number must be accurate to 2 decimal digits.

    输入输出样例

    输入样例#1: 复制
    2
    1
    12
    输出样例#1: 复制
    1.00
    37.24
    提示
    标程仅供做题后或实在无思路时参考。
    请自觉、自律地使用该功能并请对自己的学习负责。
    如果发现恶意抄袭标程,将按照I类违反进行处理。