当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6449:Sequences Generator

Special Judge 特殊评判
题目描述
The RBM Second Generation of Dual Core Microprocessor Chip, also known as RBM2gDCMC, can generate a digital sequence of length $n$.
Each digit in a sequence provided by RBM2gDCMC is regarded as an integer between $1$ and $n$ in this problem.

Now I will show you the passcode for the email belonging to Gini Romety, which is a sequence of length $m$ with integers between $1$ and $n$.
You are asked to calculate the probabilities of the coincidence with Gini Romety's passcode for all consecutive subsequence of length $m$ in a sequence generated by RBM2gDCMC.
输入解释
The input contains several test cases, and the first line contains a positive integer $T$ indicating the number of test cases which is up to $5000$.

For each test case, the first line contains two integers $n$ and $m$, satisfying $1 \leq m \leq n \leq 3 \times 10^5$, which are described as above.

The following $n$ lines describe the generating logic for all digits in a sequence built by RBM2gDCMC.
The $i$-th line of them contains two integers $l_i$ and $r_i$, satisfying $1 \leq l_i \leq r_i \leq n$ and $r_i - l_i \leq 9$, and $(r_i - l_i + 1)$ following integers, denoted by $w_{i, l_i}, w_{i, l_i + 1}, \cdots, w_{i, r_i}$, where $0 \leq w_{i, j} \leq 10^9$ and $\sum_{j}{w_{i, j}} = 10^9$.
These data indicate that for the $i$-th digit the probability of being an integer $j$ in $[1, l_i) \cup (r_i, n]$ is zero, and the probability of being an integer $j$ in $[l_i, r_i]$ is $\frac{w_{i, j}}{10^9}$.

The next line contains $m$ integers, denoted by $b_1, b_2, \cdots, b_m$, describing the passcode for Gini Romety's email, where $1 \leq b_1, b_2, \cdots, b_m \leq n$.

We guarantee that the sum of $n$ in all test cases is no larger than $2 \times 10^6$.
输出解释
For each test case, output a line containing "Case #x:" (without quotes) at first, where x is the test case number starting from $1$.

After that, output $(n - m + 1)$ lines such that the $i$-th of them contains a real number indicating the probability of the coincidence for the passcode of Gini Romety's email and the subsequence of a sequence produced by RBM2gDCMC from the $i$-th digit to the $(i + m - 1)$-th one with an absolute error of at most $10^{-9}$.
Precisely speaking, assume that your answer is $a$ and the jury's answer is $b$, your answer will be considered correct if $|a - b| \le 10^{-9}$, where $|x|$ means the absolute value of $x$.
输入样例
1
5 3
1 3 100000000 200000000 700000000
1 3 600000000 150000000 250000000
1 3 333333333 333333334 333333333
3 4 450000000 550000000
1 3 999999998 1 1
1 2 3
输出样例
Case #1:
0.004999999995000
0.090000000180000
0.000000000000000
来自杭电HDUOJ的附加信息
Recommend chendu

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6449

最后修改于 2020-10-25T23:31:26+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000/8000MS(Java/Others) 327680/327680K(Java/Others)