598066456 2010-07-06 00:22:00
点我顶贴
收藏
删除
var
a,b:array[1..2000] of integer;
n,m,i,j,t,tot:Integer;
begin
readln(n,m);
for i:=1 to n do readln(a[i]);
for i:=1 to m do readln(b[i]);
for i:=1 to n do
for j:=i+1 to n do
if a[i]<a[j] then
begin
t:=a[i];a[i]:=a[j];a[j]:=t;
end;
for i:=1 to m do
for j:=i+1 to m do
if b[i]<b[j] then
begin
t:=b[i];b[i]:=b[j];b[j]:=t;
end;
for i:=1 to n do
begin
t:=1;
while a[i]<b[t] do
begin
t:=t+1;
if t>m then break;
end;
if t<=m then begin inc(tot);b[t]:=maxint;end
else break;
end;
writeln(m-tot);
end.