- 校门外的树
- 2009-04-28 11:41:00 @
var L,i,j,n:1..10000;
M:1..100;
a,b:array[1..100] of integer;
s:array[1..10000] of integer;
begin
readln(L,M);
for i:=0 to L do
s[i]:=1;
for i:=1 to M do
begin
readln(a[i],b[i]);
for j:=a[i] to b[i] do
s[j]:=0;
end;
n:=0;
for i:=0 to L do
n:=n+s[i];
writeln(n);
end.
1 条评论
-
小吴 LV 7 @ 2009-04-28 13:45:13
数组从0开到1000;
- 1