QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 512 MB Total points: 100

#5036. 卑鄙的下毒人

الإحصائيات

题目背景

problem_5036_1.png

题目描述

演讲家喜欢吃黄油蛋糕,他准备用 $n$ 种原料制作 $m$ 个黄油蛋糕,第 $i$ 个黄油蛋糕由 $[l_i,r_i]$ 中的原料制成。

小鱼人想要毒死演讲家,他可以执行以下两种操作:

  1. 在某一原料中加入一瓶毒药,花费 $k$ 的代价,$k$ 是一个给定正整数。
  2. 在某一黄油蛋糕中加入一瓶毒药,花费 $1$ 的代价。

注意同一原料或同一黄油蛋糕中可以被下多次毒。

如果第 $i$ 个黄油蛋糕中,所有组成他的原料中的毒药数的和 $+$ 这个黄油蛋糕中的毒药数 $\ge a_i$,那这个黄油蛋糕就有剧毒,其中 $a_i$ 是给定正整数。

小鱼人想让所有黄油蛋糕都有剧毒,最少代价?

输入格式

第一行三个正整数 $n,m,k$,分别表示原料数量,黄油蛋糕数量,在原料中下毒的代价。

之后 $m$ 行,每行两个整数 $l_i,r_i,a_i$,意义见题目描述。

输出格式

一行一个整数,表示最少代价。

输入样例

3 2 1
1 2 1
2 3 2

输出样例

2

数据范围

对于所有数据,$1\le n,m \le 5\times 10^5,1\le k\le 5,1\le a_i\le 10^9$

子任务编号 $n \le $ $m \le $ $k \le $ $a_i \le $ 分值
$1$ $20$ $20$ $5$ $1$ $10$
$2$ $5\,000$ $5\,000$ $10^9$ $20$
$3$ $5 \times 10^5$ $5 \times 10^5$ $1$ $20$
$4$ $5$ $1$ $20$
$5$ $10^9$ $30$
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.