CF150C.Smart Cheater

提高+/省选-

通过率:0%

时间限制:5.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

I guess there's not much point in reminding you that Nvodsk winters aren't exactly hot. That increased the popularity of the public transport dramatically. The route of bus 62 has exactly n stops (stop 1 goes first on its way and stop n goes last). The stops are positioned on a straight line and their coordinates are 0 = _x_1 < _x_2 < ... < x__n.

Each day exactly m people use bus 62. For each person we know the number of the stop where he gets on the bus and the number of the stop where he gets off the bus. A ticket from stop a to stop b (a < b) costs x__b - x__a rubles. However, the conductor can choose no more than one segment NOT TO SELL a ticket for. We mean that conductor should choose C and D (С <= D) and sell a ticket for the segments [A, C] and [D, B], or not sell the ticket at all. The conductor and the passenger divide the saved money between themselves equally. The conductor's "untaxed income" is sometimes interrupted by inspections that take place as the bus drives on some segment of the route located between two consecutive stops. The inspector fines the conductor by c rubles for each passenger who doesn't have the ticket for this route's segment.

You know the coordinated of all stops x__i; the numbers of stops where the i-th passenger gets on and off, a__i and b__i (a__i < b__i); the fine c; and also p__i — the probability of inspection on segment between the i-th and the i + 1-th stop. The conductor asked you to help him make a plan of selling tickets that maximizes the mathematical expectation of his profit.

我想没必要再提醒你,Nvodsk 的冬天可一点也不暖和。这使得公共交通的受欢迎程度急剧上升。62 路公交车的路线恰好有 nn 个站点(第 1 站是线路起点,第 nn 站是终点)。这些站点位于一条直线上,其坐标满足 0=x1<x2<⋯<xn0 = x_1 < x_2 < \dots < x_n。

每天恰好有 mm 名乘客乘坐 62 路公交车。对每位乘客,我们已知其上车站点编号和下车站点编号。从站点 aa 到站点 bb(其中 a<ba < b)的车票价格为 xb−xax_b - x_a 卢布。然而,售票员最多可以选择一个区间不售出车票:即售票员需选定 CC 和 DD(满足 C≤DC \le D),并仅出售区间 [A,C][A, C] 和 [D,B][D, B] 上的车票;或者干脆整段都不出售车票。售票员与乘客将因此节省的金额平分。售票员的“未申报收入”有时会因检查而中断——检查发生在公交车行驶于某两个相邻站点之间的路段上。对于每个在该路段上没有对应车票的乘客,检查员将向售票员处以 cc 卢布的罚款。

你已知所有站点的坐标 xix_i;第 ii 位乘客的上车站点与下车站点编号 aia_i 和 bib_i(满足 ai<bia_i < b_i);罚款金额 cc;以及 pip_i —— 在第 ii 个站点与第 i+1i+1 个站点之间路段发生检查的概率。售票员请你帮他制定一个车票销售方案,以最大化其收益的数学期望值。

输入格式

The first line contains three integers n, m and c (2 ≤ n ≤ 150 000, 1 ≤ m ≤ 300 000, 1 ≤ c ≤ 10 000).

The next line contains n integers x__i (0 ≤ x__i ≤ 109, _x_1 = 0, x__i < x__i + 1) — the coordinates of the stops on the bus's route.

The third line contains n - 1 integer p__i (0 ≤ p__i ≤ 100) — the probability of inspection in percents on the segment between stop i and stop i + 1.

Then follow m lines that describe the bus's passengers. Each line contains exactly two integers a__i and b__i (1 ≤ a__i < b__i ≤ n) — the numbers of stops where the i-th passenger gets on and off.

第一行包含三个整数 nn、mm 和 cc(满足 2 ≤ n ≤ 150 0002 \leq n \leq 150\,000,1 ≤ m ≤ 300 0001 \leq m \leq 300\,000,1 ≤ c ≤ 10 0001 \leq c \leq 10\,000)。

第二行包含 nn 个整数 xix_i(满足 0 ≤ xi ≤ 1090 \leq x_i \leq 10^9,x1 = 0x_1 = 0,且 xi < xi+1x_i < x_{i+1}),表示公交车路线上的各站点坐标。

第三行包含 n−1n-1 个整数 pip_i(满足 0 ≤ pi ≤ 1000 \leq p_i \leq 100),表示在第 ii 站与第 i+1i+1 站之间路段进行检查的概率(以百分比表示)。

接下来是 mm 行,描述公交车的乘客信息。每行恰好包含两个整数 aia_i 和 bib_i(满足 1 ≤ ai < bi ≤ n1 \leq a_i < b_i \leq n),表示第 ii 位乘客上车和下车的站点编号。

输出格式

Print the single real number — the maximum expectation of the conductor's profit. Your answer will be considered correct if its absolute or relative error does not exceed 10 - 6.

Namely: let's assume that your answer is a, and the answer of the jury is b. The checker program will consider your answer correct, if .

输出一个实数——指挥家利润的最大期望值。若你的答案的绝对或相对误差不超过 10−610^{-6},则视为正确。

即:假设你的答案为 aa,评测组的答案为 bb。当满足 时,评测程序将判定你的答案正确。

输入输出样例

  • 输入#1

    3 3 10
    0 10 100
    100 0
    1 2
    2 3
    1 3

    输出#1

    90.000000000
  • 输入#2

    10 8 187
    0 10 30 70 150 310 630 1270 2550 51100
    13 87 65 0 100 44 67 3 4
    1 10
    2 9
    3 8
    1 5
    6 10
    2 7
    4 10
    4 5

    输出#2

    76859.990000000

说明/提示

A comment to the first sample:

The first and third passengers get tickets from stop 1 to stop 2. The second passenger doesn't get a ticket. There always is inspection on the segment 1-2 but both passengers have the ticket for it. There never is an inspection on the segment 2-3, that's why the second passenger gets away with the cheating. Our total profit is (0 + 90 / 2 + 90 / 2) = 90.

对第一个样例的说明:

第一位和第三位乘客购买了从第 1 站到第 2 站的车票。第二位乘客没有购票。区间 1-21\text{-}2 上始终有检票,但两位乘客均持有该区间的有效车票。区间 2-32\text{-}3 上从不检票,因此第二位乘客的逃票行为未被发现。我们的总收益为 (0+90/2+90/2)=90(0 + 90 / 2 + 90 / 2) = 90。

输入解题思路,AI测评打分。不知道怎么写?

首页