-
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
-
SVDSTest
SDVS(a,k) test for matlabpool open local 8
Run in Xeon 8 cores
- 2010-12-03 06:01:48下载
- 积分:1
-
optical-pulse-evolution-equation
光纤中光脉冲演化方程的数值解的计算机仿真研究(The fiber optical pulse evolution equation of the numerical solution of simulation research)
- 2012-08-23 18:39:18下载
- 积分:1
-
dea
基本的DNA进化算法,使用MATLAB编程,能完成基本的DNA计算,改进后能够对参数进行寻优等功能(Basic DNA evolutionary algorithm,MATLAB-based source code,To complete the basic DNA computing,Improved parameters to find excellent features)
- 2012-04-17 16:16:02下载
- 积分:1
-
num2str
主要用于matlab中的一些基本方法的介绍 以一些功能简介,适合初学matlab用户(used for matlab)
- 2012-05-12 08:25:39下载
- 积分:1
-
growcut
growcut algorithm is implemented for segmentation purpose
- 2013-09-19 17:52:08下载
- 积分:1
-
Feedback-Neural-Networks
采用Matlab实现反馈神经网络构建,共有15个例子。(Feedback is realized by using the Matlab neural network building.)
- 2014-12-12 08:35:01下载
- 积分:1
-
untitled001
直流恒负载转速调节,转速环突然断路matlab(DC Constant load speed regulation, speed loop circuit suddenly matlab)
- 2010-07-11 22:33:44下载
- 积分:1
-
ppcatss
一种matlab工具箱,关于PPCATSS的。(a kind of matlab toolbox.....)
- 2010-12-06 19:01:24下载
- 积分:1
-
Construction-and-Realization
关于三次样条插值在matlab中的实现,给出了源程序(Construction and Realization of Cubic Spline Interpolation Function )
- 2012-03-31 11:45:00下载
- 积分:1