diff --git a/QUSTOJ/1092.pas b/QUSTOJ/1092.pas new file mode 100644 index 0000000..aa1b75e --- /dev/null +++ b/QUSTOJ/1092.pas @@ -0,0 +1,37 @@ +var e:array[1..10] of longint; +w,d:array[1..50000] of longint; +i,m,n,j:longint; + +procedure ss(x,y:longint); +var ii,jj,s,o,aa:longint; +begin +ii:=x;jj:=y; +s:=w[(x+y) shr 1]; +aa:=d[(x+y) shr 1]; +repeat +while (w[ii]>s) or ((w[ii]=s) and (d[ii]aa)) do dec(jj); +if ii<=jj then begin +o:=w[ii];w[ii]:=w[jj];w[jj]:=o; +o:=d[ii];d[ii]:=d[jj];d[jj]:=o; +inc(ii);dec(jj); +end; +until ii>jj; +if x