-
2
说明: 有一个长度为整数L(1<=L<=10000)的马路,可以想象成数轴上长度为L的一个线段,起点是坐标原点,在每个整数坐标点有一棵树,即在0,1,2,...,L共L+1个位置上有L+1棵树。
现在要移走一些树,移走的树的区间用一对数字表示,如 100 200表示移走从100到200之间(包括端点)所有的树。
可能有M(1<=M<=100)个区间,区间之间可能有重叠。现在要求移走所有区间的树之后剩下的树的个数。
输入:
两个整数L(1<=L<=10000)和M(1<=M<=100)。
接下来有M组整数,每组有一对数字。
输出:
可能有多组输入数据,对于每组输入数据,输出一个数,表示移走所有区间的树之后剩下的树的个数。(Has a length of integer L (1 < = L < = 10000) of the road, one can imagine a number line segment of length L, the starting point is the coordinate origin, each integer coordinate points in a tree, i.e. 0,1 , 2, ..., L total has L+1 L+1 positions on the tree. Now to remove some trees, tree removed by a range of digitally represented, such as 100 200 represents removed (inclusive) between 100 and 200 all the trees. There may be M (1 < = M < = 100) intervals, there may be overlap between the intervals. Now, after the number of trees require the removal of all remaining sections of the tree. Input: two integer L (1 < = L < = 10000) and M (1 < = M < = 100). Then there is an integer M groups, each with a pair of numbers. Output: there may be multiple sets of input data, for each set of input data, the output of a number indicating the number of the removal of all remaining sections of the tree after tree.)
- 2015-03-22 23:35:47下载
- 积分:1
-
四机两区
粒子群优化算法计算出的PSS优化模型,为四机两区模型(PSS optimization model calculated by particle swarm optimization algorithm)
- 2020-12-30 00:09:00下载
- 积分:1
-
Visual-CPPand-Matlab
数字图象处理与机器视觉Visual C++与Matlab实现,光盘源代码(Digital image processing and machine vision Visual C++ with Matlab, CD-ROM source code)
- 2013-12-24 12:02:43下载
- 积分:1
-
experiment_1
实验一、数字图像读取及色彩、亮度、对比度变化(c++)
- 2011-01-04 19:15:51下载
- 积分:1
-
WmImages
windows media format 9 for images(nine windows media format for images)
- 2006-06-02 16:21:21下载
- 积分:1
-
20100503
说明: 本文件包含了MATLAB语言常用算法程序,可为初学者提供有效快捷的学习通道。(This document contains the MATLAB language commonly used algorithm program for beginners to learn to provide effective and efficient channel.)
- 2010-05-04 16:32:43下载
- 积分:1
-
main
这是一个基于颜色直方图的粒子滤波目标跟踪的主程序,比较完整,供大家参考(This is a color histogram based particle filter tracking the main program, more complete, for your reference)
- 2011-05-22 10:54:08下载
- 积分:1
-
1
说明: 光电开关及其应用光电开关及其应用光电开关及其应用(Photoelectric switch and its application photoelectric switch photoelectric switch and its applications and its application)
- 2010-03-07 18:00:29下载
- 积分:1
-
unlinercontrol
非线性系统鲁棒无模型学习自适应控制论文,内容见附件(Nonlinear systems model-free learning adaptive control study, the content of Annex)
- 2010-11-11 01:14:27下载
- 积分:1
-
imge-information-hiding
matlab 图像信息隐藏 LSB方法(LSB method of information hiding matlab)
- 2011-05-27 14:58:36下载
- 积分:1