rt 2019-05-08 06:04:02
点我顶贴
收藏
删除
var
l,m,i,x,y,j,sum:longint;
a:array[0..10000] of boolean;
begin
readln(l,m);
for i:=1 to m do
begin
readln(x,y);
for j:=x to y do
a[j]:=true;
end;
for i:=0 to l do
if not a[i] then inc(sum);
writeln(sum);
end.