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

建议使用的浏览器:

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

6309:Absolute

题目描述
Winter is here at the North and the White Walkers are close. There's a young Night Watch standing on the Wall.
The young Night Watch has created a method to keep his body warm. Every time he generate a random rational number x in range $[l_i, r_i]$ independently and uniformly, then he walks x meters to east.
Now he has n ranges $[l_1, r_1], [l_2, r_2] ... [l_n, r_n]$, He wants to know the expected distance to origin. If answer is a fraction $\frac{p}{q}$, output an integer $0 \leq s < 998244353$ so that $p \equiv sq~(mod~998244353)$.
输入解释
An integer n in the first line. $1 \leq n \leq 15$
The following n lines, each contain two integers $l_i, r_i$. $(-10^6 \leq l_i \leq r_i \leq 10^6)$
输出解释
Output the expected distance to origin in a line, modulo 998244353.
输入样例
2
-2 3
-2 1
输出样例
199648872
来自杭电HDUOJ的附加信息
Recommend chendu

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

源链接: HDU-6309

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

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)