AT_abc456_b.456

入门

通过率:0%

时间限制:2.00s

内存限制:1024MB

AC君温馨提醒

该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

There are three dice, each with six faces.
The jj-th face of the ii-th die has Ai,jA_{i,j} written on it.
For each die, each face comes up with probability 16\frac{1}{6}.

When these dice are rolled simultaneously, find the probability that the values 4,5,64,5,6 each appear exactly once.

有三个骰子,每个骰子有六个面。
第 ii 个骰子的第 jj 个面上写有数字 Ai,jA_{i,j}。
对于每个骰子,每个面朝上的概率均为 16\frac{1}{6}。

当这三个骰子同时掷出时,求数字 4,5,64,5,6 各恰好出现一次的概率。

输入格式

The input is given from Standard Input in the following format:

A1,1A_{1,1} A1,2A_{1,2} A1,3A_{1,3} A1,4A_{1,4} A1,5A_{1,5} A1,6A_{1,6}
A2,1A_{2,1} A2,2A_{2,2} A2,3A_{2,3} A2,4A_{2,4} A2,5A_{2,5} A2,6A_{2,6}
A3,1A_{3,1} A3,2A_{3,2} A3,3A_{3,3} A3,4A_{3,4} A3,5A_{3,5} A3,6A_{3,6}

输入从标准输入中按以下格式给出:

A1,1A_{1,1} A1,2A_{1,2} A1,3A_{1,3} A1,4A_{1,4} A1,5A_{1,5} A1,6A_{1,6}
A2,1A_{2,1} A2,2A_{2,2} A2,3A_{2,3} A2,4A_{2,4} A2,5A_{2,5} A2,6A_{2,6}
A3,1A_{3,1} A3,2A_{3,2} A3,3A_{3,3} A3,4A_{3,4} A3,5A_{3,5} A3,6A_{3,6}

输出格式

Output the answer. The answer is considered correct if the absolute or relative error from the true answer is at most 10−610^{-6}.

输出答案。若答案与真实答案的绝对误差或相对误差不超过 10−610^{-6},则视为正确。

输入输出样例

  • 输入#1

    1 2 3 4 5 6
    1 2 3 4 5 6
    1 2 3 4 5 6

    输出#1

    0.0277777778
  • 输入#2

    4 5 6 4 5 6
    4 4 5 5 6 6
    6 5 4 4 5 6

    输出#2

    0.2222222222

说明/提示

Sample 1 Explanation:
The desired probability is 136\frac{1}{36}. An output such as 0.027778 is also accepted.

Sample 2 Explanation:
The desired probability is 29\frac{2}{9}.

Constraints

  • Ai,jA_{i,j} is an integer between 11 and 66, inclusive.

样例 1 解释:
所求概率为 136\frac{1}{36}。输出如 0.027778 也是可接受的。

样例 2 解释:
所求概率为 29\frac{2}{9}。

限制条件

  • Ai,jA_{i,j} 是介于 11 和 66(含)之间的整数。

输入解题思路,AI测评打分。不知道怎么写?

首页