- 苹果摘陶陶
- 2016-09-27 12:59:57 @
program ex5;
var n,m:integer;
a,b:array[1..2000] of integer;
t:array[1..2000] of boolean;
i,j:integer;
z:integer;
max:integer;
sum:integer;
begin
read(n,m);
max:=0;
sum:=0;
z:=0;
for i:=1 to n do
read(a[i]);
for i:=1 to m do
begin
read(b[i]);
t[i]:=true;
end;
for i:=1 to n do
begin
for j:=1 to m do
if (a[i]>b[j]) and (t[j]=true) and (b[j]>max) then
begin
max:=b[j];
z:=j;
end;
t[z]:=false;
max:=0;
z:=0;
end;
for i:=1 to m do
if t[i]=true then sum:=sum+1;
write(sum);
writeln;
end.