- 校门外的树
- 2009-06-06 17:18:27 @
type atype=set of 0..10001;
arrest=array[1..100] of atype;
var a:arrest;
b:array[1] of atype;
i,j,l,m,x,y:longint;
begin
read(l,m);
for i:=1 to 100 do a[i]:=[];
for i:=1 to m do
begin
read(x,y);
a[i]:=[x..y];
end;
b[1]:=[10001];
for i:=1 to m do
b[1]:=b[1]+a[i];
j:=l+1;
for i:=0 to 10000 do
if i in b[1] then dec(j);
writeln(j);
end.
1 条评论
-
dragonfly LV 8 @ 2009-06-06 21:29:57
P的集合元素貌似最多只有255
哈希数组不行吗
- 1