讨论 / 题解pascal
雪虎 2017-10-14 11:55:32
点我顶贴 收藏 删除
var

l,m,i,j,x,y,s:longint;

a:array[0..10000]of longint;

begin

readln(l,m);

for i:=1 to m do

begin

readln(x,y);

for j:=x to y do a[j]:=1;

end;

s:=0;

for i:=0 to l do

if a[i]=0 then s:=s+1;

writeln(s);

end.

查看更多回复
提交回复