贪心
尽可能让最强的赢,最弱的赢,都不行则最弱打最强
感性的想,我肯定要尽可能的赢,而且赢的要对等
实在不能赢就拿最小的拼,所谓的田忌赛马策略
由于总分一定,己方最差即己方最好时对方的分数
1 type list=array[0..100010] of longint; 2 var a,b:list; 3 n,i:longint; 4 5 procedure qsort(var a:list); 6 procedure sort(l,r: longint); 7 var i,j,x,y: longint; 8 begin 9 i:=l;10 j:=r;11 x:=a[(l+r) div 2];12 repeat13 while a[i]>x do inc(i);14 while x>a[j] do dec(j);15 if not(i>j) then16 begin17 y:=a[i];18 a[i]:=a[j];19 a[j]:=y;20 inc(i);21 j:=j-1;22 end;23 until i>j;24 if lb[h2] then43 begin44 inc(h1);45 inc(h2);46 ans:=ans+2;47 end48 else if a[t1]>b[t2] then49 begin50 dec(t1);51 dec(t2);52 ans:=ans+2;53 end54 else begin55 if a[t1]=b[h2] then inc(ans);56 dec(t1);57 inc(h2);58 end;59 end;60 end;61 62 begin63 readln(n);64 for i:=1 to n do65 readln(a[i]);66 qsort(a);67 for i:=1 to n do68 readln(b[i]);69 qsort(b);70 writeln(ans(a,b),' ',2*n-ans(b,a));71 end.