陶陶抢苹果(vijos1445)

算法:模拟
 

很裸的一道模拟题了,不解释了……


program VJ1445;

const
 maxn=100000;

var
 n,m:longint;
 a,b,ans,d,dd:array [0..maxn] of longint;

procedure init;
var
 i:longint;
begin
 fillchar(ans,sizeof(ans),0);
 readln(n,m);
 for i:=1 to n do read(a[i]);
 for i:=1 to m do 
  begin
   read(b[i]);
   d[i]:=i;
  end;
end;

procedure qsort1(l,r:longint);
var
 i,j,t1,t:longint;
begin
 i:=l;
 j:=r;
 t1:=a[(l+r) shr 1];
 repeat
  while a[i]>t1 do inc(i);
  while a[j]j;
 if it1 do inc(i);
  while b[j]j;
 if i




你可能感兴趣的:(vijos)