Create 1099_guoqianli.pas

From https://vijos.org/p/1291/solution
pull/12/head
KiritoTRw 2016-05-02 13:56:01 +08:00
parent ec1c635c26
commit 7d40413c6c
1 changed files with 22 additions and 0 deletions

22
QUSTOJ/1099_guoqianli.pas Normal file
View File

@ -0,0 +1,22 @@
var a,b:array[1..10000]of longint;
c,d:array[1..10000]of boolean;
n,m,i,j,k,max:longint;
begin
max:=0;
fillchar(c,sizeof(c),true);
d:=c;
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-1 do
for j:=i+1 to n do
if a[i]<a[j] then begin k:=a[i]; a[i]:=a[j]; a[j]:=k; end; for i:=1 to m-1 do for j:=i+1 to m do if b[i]<b[j] then begin k:=b[i]; b[i]:=b[j]; b[j]:=k; end; for i:=1 to n do for j:=1 to m do if b[j]>0 then
if (a[i]>b[j])and(c[i])and(d[j])then
begin
inc(max);
c[i]:=false;
d[j]:=false;
break;
end;
writeln(m-max);
end.