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

建议使用的浏览器:

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

6848:Expectation

题目描述
Notice:Don't output extra spaces at the end of one line.

There are $(2n+1)$ distinct positions on the number line, $x_1,x_2,....x_{2n+1}$ in the strictly increasing order. each position with odd index is a hole and each postition with even index is a ball.

Koishi will play a game consisting of $n$ rounds, in each round:

1.Koishi selects a ball that isn't in holes at random.

2.then select the direction,left or right at random.

3.then the chosen ball starts rolling in that chosen direction, until it falls into an empty hole(the hole with no ball falling into it before)

Koishi is interested in the sum of distances of balls rolling. What is the expected value of the sum? modulo $998244353$
输入解释
First line contains an integer $T(1\leq T\leq 2000)$, number of test cases.

In each test cases, the first line contains an integer $n(1\leq n\leq 3000)$. The second line contains $(2n+1)$ integers in a single line representing $x_1,x_2,...x_{2n+1}$

$-10^9\leq x_1<x_2,...,<x_{2n+1}\leq 10^9$
输出解释
$T$ lines, each with a non-negative integer representing the answer.
输入样例
3
1
1 2 3
3
1 2 3 4 5 6 7
10
0 1 3 6 10 15 21 28 36 45 55 66 78 91 105 120 136 153 171 190 210
输出样例
1
332748122
969129126
来自杭电HDUOJ的附加信息
Recommend IceyWang

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

源链接: HDU-6848

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

共提交 0

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