3 人解决,9 人已尝试。
3 份提交通过,共有 64 份提交。
9.1 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
The players A and B are playing a game with dice. Player A throws $n_a$ of his dice, while player B throws $n_b$ of his dice. Each of them adds the pips on his dice, and the player with the higher sum wins the game (if both get the same sum, it is a draw). The variables $s_a$ and $s_b$ have $6$ elements each, and describe how many pips are on each side of the dice of player A and player B respectively. Each die has exactly $1/6$ probability for each possible outcome.
There are many tests! In each test first line give the number of dice $n_a$ ($1 \le n_a \le 20$) and $n_b$ ($1 \le n_n \le 20$) each player throws, next two line each six integers ($1 \le \mathrm{integers} \le 100$) indicate their configurations $s_a$ and $s_b$.
Compute and output the probability that player A wins the game.
Your value must have an absolute or relative error less than $10^{-9}$.
1 1 1 2 3 4 5 6 1 2 3 4 5 6 2 3 1 1 1 2 2 2 1 1 1 1 1 1
0.416666667 0.250000000
case 1: This is the simple case, where each player throws a normal die once. Of the 36 possible outcomes, 6 are a tie (both players throw the same number), 15 a win for A and 15 a win for B. So player A wins 15/36 of the games.
case 2: Note that dice can have several equal sides. Here, player B gets a sum of 3. Player A can beat that only if he gets a 2 on both his throws, giving him a 1/4 chance of winning.
3 人解决,9 人已尝试。
3 份提交通过,共有 64 份提交。
9.1 EMB 奖励。
创建: 16 年,9 月前.
修改: 7 年前.
最后提交: 4 年,1 月前.
来源: N/A