- 火烧赤壁
- 2009-02-19 13:00:29 @
var
n,i,j,k,min,max:longint;
a,b,c:array[-200000000..20000000]of longint;
begin
read(n);
for i:=1 to n do
begin
read(a[i],b[i]);
if a[i]max then max:=b[i] else max:=max;
end;
for i:=1 to n do
if a[i]b[i] then
for j:=a[i] to b[i]-1 do
c[j]:=1;
k:=0;
for i:=min to max do
if c[i]=1
then inc(k)
else k:=k;
write(k);
end.
1 条评论
-
盗板桥 LV 8 @ 2013-08-29 20:49:15
你开的太大了,换个算法吧
- 1