From e89bc937745171199594b0b028f1ab60a37fe90c Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Mon, 2 May 2016 13:38:38 +0800 Subject: [PATCH] Create 1282.pas --- VIJOS/1282.pas | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 VIJOS/1282.pas diff --git a/VIJOS/1282.pas b/VIJOS/1282.pas new file mode 100644 index 0000000..aa1b75e --- /dev/null +++ b/VIJOS/1282.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