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 nn pipes with coordinates xix_i that are connected to LCC. When the experiment starts at time 0, ii-th proton flies from the ii-th pipe with speed viv_i. It flies to the right with probability pip_i and flies to the left with probability (1−pi)(1 - p_i). 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)。有 nn 根管道,其坐标为 xix_i,连接至 LCC。实验于时刻 0 启动,第 ii 个质子从第 ii 根管道出发,速度为 viv_i。该质子以概率 pip_i 向右运动,以概率 (1−pi)(1 - p_i) 向左运动。实验持续时间定义为任意两个质子首次发生碰撞的时刻;若不会发生任何碰撞,则实验持续时间视为 0。

求实验持续时间的期望值。

第一个样例的示意图

输入格式

The first line of input contains one integer nn — the number of pipes (1≤n≤1051 \le n \le 10^5). Each of the following nn lines contains three integers xix_i, viv_i, pip_i — the coordinate of the ii-th pipe, the speed of the ii-th proton and the probability that the ii-th proton flies to the right in percentage points (−109≤xi≤109,1≤v≤106,0≤pi≤100-10^9 \le x_i \le 10^9, 1 \le v \le 10^6, 0 \le p_i \le 100). It is guaranteed that all xix_i are distinct and sorted in increasing order.

输入的第一行包含一个整数 nn —— 管道的数量(1≤n≤1051 \le n \le 10^5)。接下来的 nn 行中,每行包含三个整数 xix_i、viv_i、pip_i —— 分别表示第 ii 条管道的坐标、第 ii 个质子的速度,以及第 ii 个质子向右飞行的概率(以百分比数值表示)(−109≤xi≤109-10^9 \le x_i \le 10^9,1≤vi≤1061 \le v_i \le 10^6,0≤pi≤1000 \le p_i \le 100)。保证所有 xix_i 互不相同且按升序排列。

输出格式

It's possible to prove that the answer can always be represented as a fraction P/QP/Q, where PP is an integer and QQ is a natural number not divisible by 998 244 353998\,244\,353. In this case, print P⋅Q−1P \cdot Q^{-1} modulo 998 244 353998\,244\,353.

可以证明答案总能表示为分数 P/QP/Q,其中 PP 是整数,QQ 是不被 998 244 353998\,244\,353 整除的正整数。此时,请输出 P⋅Q−1P \cdot Q^{-1} 对 998 244 353998\,244\,353 取模的结果。

输入输出样例

  • 输入#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测评打分。不知道怎么写?

首页