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

建议使用的浏览器:

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

2620:Minimal coverage

Special Judge 特殊评判
题目描述
Given set of line segments [Li , Ri] with integer coordinates of their end points. Your task is to find the minimal subset of the given set which covers segment [0,M] completely (M is a positive integer).
输入解释
First line of the input contains number M (1 <= M <= 5000). Subsequent lines of input contain pairs of numbers Li and Ri (abs(Li), abs(Ri) <= 50000). Each pair is placed on separate line. Numbers in the pair are separated with space(s). List of pairs is ended with pair of integers "0 0". i <= 100000
输出解释
Your program should print in the first line of output the power of minimal subset of segments which covers segment [0, M]. The list of segments of covering subset must follow. Format of the list must be the same as described in input with exception that ending pair "0 0" should not be printed. Segments should be printed in increasing order of their left end point coordinate.

If there is no covering subset then print "No solution" to output.
输入样例
1
-1 0
-5 -3
2 5
0 0
输出样例
No solution
提示
Huge input,scanf is recommended.
Sample input #2
1
-1 0
0 1
0 0

Sample output #2
1
0 1

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2620

最后修改于 2020-10-29T06:37:23+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536