level 6
L1613456497
楼主
var x,y,q,w,e:array[1..100000]of longint;
i,j,a,b,c,m,n:longint;
begin
fillchar(x,sizeof(x),0);
read(n,m);
for i:=1 to m do
read(q[i],w[i],e[i]);
for i:=1 to m do
if q[i]=0 then
for j:=w[i] to e[i] do x[j]:=1;
if q[i]=1 then
for j:=w[i] to e[i] do
begin
if x[j]=1 then inc(a);
end;
writeln(a);
end.
2015年09月27日 05点09分
1
i,j,a,b,c,m,n:longint;
begin
fillchar(x,sizeof(x),0);
read(n,m);
for i:=1 to m do
read(q[i],w[i],e[i]);
for i:=1 to m do
if q[i]=0 then
for j:=w[i] to e[i] do x[j]:=1;
if q[i]=1 then
for j:=w[i] to e[i] do
begin
if x[j]=1 then inc(a);
end;
writeln(a);
end.