CF1286D.LCC
NOI/NOI+/CTSC
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
An infinitely long Line Chillland Collider (LCC) was built in Chillland. There are n pipes with coordinates xi that are connected to LCC. When the experiment starts at time 0, i-th proton flies from the i-th pipe with speed vi. It flies to the right with probability pi and flies to the left with probability (1−pi). The duration of the experiment is determined as the time of the first collision of any two protons. In case there is no collision, the duration of the experiment is considered to be zero.
Find the expected value of the duration of the experiment.
Illustration for the first example
在 Chillland 建造了一台无限长的直线 Chillland 对撞机(LCC)。有 n 根管道,其坐标为 xi,连接至 LCC。实验于时刻 0 启动,第 i 个质子从第 i 根管道出发,速度为 vi。该质子以概率 pi 向右运动,以概率 (1−pi) 向左运动。实验持续时间定义为任意两个质子首次发生碰撞的时刻;若不会发生任何碰撞,则实验持续时间视为 0。
求实验持续时间的期望值。
第一个样例的示意图
输入格式
The first line of input contains one integer n — the number of pipes (1≤n≤105). Each of the following n lines contains three integers xi, vi, pi — the coordinate of the i-th pipe, the speed of the i-th proton and the probability that the i-th proton flies to the right in percentage points (−109≤xi≤109,1≤v≤106,0≤pi≤100). It is guaranteed that all xi are distinct and sorted in increasing order.
输入的第一行包含一个整数 n —— 管道的数量(1≤n≤105)。接下来的 n 行中,每行包含三个整数 xi、vi、pi —— 分别表示第 i 条管道的坐标、第 i 个质子的速度,以及第 i 个质子向右飞行的概率(以百分比数值表示)(−109≤xi≤109,1≤vi≤106,0≤pi≤100)。保证所有 xi 互不相同且按升序排列。
输出格式
It's possible to prove that the answer can always be represented as a fraction P/Q, where P is an integer and Q is a natural number not divisible by 998244353. In this case, print P⋅Q−1 modulo 998244353.
可以证明答案总能表示为分数 P/Q,其中 P 是整数,Q 是不被 998244353 整除的正整数。此时,请输出 P⋅Q−1 对 998244353 取模的结果。
输入输出样例
输入#1
2 1 1 100 3 1 0
输出#1
1
输入#2
3 7 10 0 9 4 86 14 5 100
输出#2
0
输入#3
4 6 4 50 11 25 50 13 16 50 15 8 50
输出#3
150902884
输入解题思路,AI测评打分。不知道怎么写?