Problem 2593 --Absolute

2593: Absolute

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $1$ 正确数量 $1$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签
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 [li,ri] independently and uniformly, then he walks x meters to east. 
Now he has n ranges [l1,r1],[l2,r2]...[ln,rn], He wants to know the expected distance to origin. If answer is a fraction pq, output an integer 0≤s<998244353 so that p≡sq (mod 998244353).
An integer n in the first line. 1≤n≤15
The following n lines, each contain two integers li,ri(−106≤li≤ri≤106)
Output the expected distance to origin in a line, modulo 998244353.
2
-2 3
-2 1
199648872

推荐代码 查看2593 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] 淡意的温柔 606331 2020-07-09 15:34:25
内存最少[$2024 $KB] 淡意的温柔 606331 2020-07-09 15:34:25
第一AC 淡意的温柔 606331 2020-07-09 15:34:25
第一挑战 淡意的温柔 606331 2020-07-09 15:34:25

赛题来源/所属竞赛 HDU N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛