theLittleFox @ 2017-12-22 22:57:52
**var n,i,b,c,term,j:longint;**
**a:array[1..1000000] of longint;**
**yuwen,xue:array[1..1000000] of longint;**
**procedure qsort(l,h:integer);**
**var**
**i,j,t,m:integer;**
**begin**
**i:=l; j:=h;**
**m:=a[(i+j) div 2];**
**repeat**
**while a[i]>m do inc(i);**
**while m>a[j] do dec(j);**
**if i<=j then**
**begin**
**t:=a[i]; a[i]:=a[j]; a[j]:=t;**
**t:=yuwen[i]; yuwen[i]:=yuwen[j]; yuwen[j]:=t;**
**t:=xue[i]; xue[i]:=xue[j]; xue[j]:=t;**
**inc(i); dec(j);**
**end;**
**until i>j;**
**if i<h then qsort(i,h);**
**if j>l then qsort(l,j);**
**end;**
**begin**
**read(n);**
**for i:=1 to n do**
**begin**
**read(yuwen[i],b,c);**
**a[i]:=yuwen[i]+b+c;**
**xue[i]:=i;**
**end;**
**qsort(1,n);**
**for i:=2 to n do**
**if a[i]=a[i-1] then if yuwen[i]>yuwen[i-1] then begin term:=yuwen[i]; yuwen[i]:=yuwen[i-1]; yuwen[i-1]:=term;term:=xue[i]; xue[i]:=xue[i-1]; xue[i-1]:=term;term:=a[i]; a[i]:=a[i-1]; a[i-1]:=term;end;**
**for i:=2 to n do**
**if (a[i]=a[i-1]) and (yuwen[i]=yuwen[i-1]) then if xue[i]<xue[i-1] then begin term:=yuwen[i]; yuwen[i]:=yuwen[i-1]; yuwen[i-1]:=term;term:=xue[i]; xue[i]:=xue[i-1]; xue[i-1]:=term;term:=a[i]; a[i]:=a[i-1]; a[i-1]:=term;end;**
**for i:=1 to 5 do**
**writeln(xue[i],' ',a[i]);**
**end.**
by theLittleFox @ 2017-12-22 22:58:42
实在不知道怎么改。。。。。。。。。。。。。
by Love_Your_Heart @ 2018-01-15 20:24:58
第六个点有问题