当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6180:Schedule

题目描述
There are N schedules, the i-th schedule has start time $s_i$ and end time $e_i$ (1 <= i <= N). There are some machines. Each two overlapping schedules cannot be performed in the same machine. For each machine the working time is defined as the difference between $time_{end}$ and $time_{start}$ , where time_{end} is time to turn off the machine and $time_{start}$ is time to turn on the machine. We assume that the machine cannot be turned off between the $time_{start}$ and the $time_{end}$.
Print the minimum number K of the machines for performing all schedules, and when only uses K machines, print the minimum sum of all working times.
输入解释
The first line contains an integer T (1 <= T <= 100), the number of test cases. Each case begins with a line containing one integer N (0 < N <= 100000). Each of the next N lines contains two integers $s_i$ and $e_i$ $(0 <= s_i < e_i <= 1e9)$.
输出解释
For each test case, print the minimum possible number of machines and the minimum sum of all working times.
输入样例
1
3
1 3
4 6
2 5
输出样例
2 8
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6180

最后修改于 2020-10-25T23:29:05+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 153428/153428K(Java/Others)