- 苹果摘陶陶
- 2016-05-17 13:51:07 @
var n,m,i,j,q,d:integer;
a,b:array[1..2000] of 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 m-1 do
for j:=1 to m-i do if b[j]>b[j+1] then begin d:=b[j];b[j]:=b[j+1];b[j+1]:=d;
end;
i:=0; q:=0;
repeat
inc(i);
for j:=m downto 1 do
if (a[i]>b[j])and(b[j]<>-1)and(b[j]<>0) then
begin
inc(q);b[j]:=-1;break;
end;
until i=n;
q:=m-q;
writeln(q);
end.
0 条评论
目前还没有评论...