aaa

所属分类:数学计算
开发工具:Visual C++
文件大小:1KB
下载次数:3
上传日期:2013-04-29 21:19:12
上 传 者feichangxinku
说明:  某校大门外长度为L的马路上有一排树,每两棵相邻的树之间的间隔都是1米。我们可以把马路堪称一个数轴,马路的一端在数轴0的位置,另一端在L的位置;数轴上的每个整数点,即0,1,2,……,L,都种有一棵树。由于马路上的一些区域中的始点和终点的坐标都是整数,区域之间可能有重合部分。现在要把这些区域中的树(包括2端点)移走。计算还剩多少树?
(There are several test cases in the input. Each case starts with an integer L (1 <= L < 2000000000) representing the length of the road and M (1 <= M <= 5000) representing the number of sections that are assigned for other use.  The following M lines each describes a section. A line is in such format:  Start End  Here Start and End (0 <= Start <= End <= L) are both non-negative integers representing the start point and the end point of the section. It is confirmed that these sections do not overlap with each other.  A case with L = 0 and M = 0 ends the input.)

文件列表:
aaa.c (829, 2013-03-31)

近期下载者

相关文件


收藏者