5 人解决,15 人已尝试。
7 份提交通过,共有 41 份提交。
8.4 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
In the game of Dungeons & Dragons, players often roll multi-sided dice to generate random numbers which determine the outcome of actions in the game. These dice come in various flavors and shapes, ranging from a
When generating random numbers to fit certain ranges, it is sometimes necessary or desirable to roll several dice in conjunction and sum the values on their faces. However, we may notice that although different combinations of dice yield numbers in the same range, the probabilities of rolling each of the numbers within the range differ entirely. For example, a
Your task in this problem is to determine the probability of rolling a certain number, given the set of dice used.
The input test file will contain multiple cases, with each case on a single line of input. The line begins with an integer
For each test case, output on a single line the probability of rolling
1 d10 5 2 d6 d6 1 2 d10 d6 9 2 d8 d8 9 0
0.10000 0.00000 0.10000 0.12500
5 人解决,15 人已尝试。
7 份提交通过,共有 41 份提交。
8.4 EMB 奖励。