ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1100. Final Standings

My program is wrong and my friends laught at me :-((
Posted by fstilus_chiki 4 Sep 2015 20:08
Pls halp...

var
i, n: integer;
id:array of longint;
ball: array of integer;

procedure qSort(var ar: array of integer; ra:array of longint);
procedure sort(var ar: array of integer; low, high: integer; ra:array of longint);
var
i, j: integer;
m, wsp: integer;
b: longint;
begin
i := low; j := high; m := ar[(i + j) div 2];
repeat
while ar[i] < m do Inc(i);
while ar[j] > m do Dec(j);
if i <= j then begin
wsp := ar[i]; ar[i] := ar[j]; ar[j] := wsp;
b := ra[i]; ra[i] := ra[j]; ra[j] := b;
Inc(i); Dec(j);
end;
until i > j;
if low < j then sort(ar, low, j, ra);
if i < high then sort(ar, i, high, ra);
end;
begin
sort(ar, 0, High(ar), ra);
end;

begin
setlength(id,n);
setlength(ball,n);
for i := 0 to n-1 do
qSort(ball, id);
for i := n-1 downto 0 do
writeln(id[i], ' ', ball[i]);
end.

What's wron? Halp pleese!
Re: My program is wrong and my friends laught at me :-((
Posted by Egor 20 Sep 2015 19:00
don't use that language
Re: My program is wrong and my friends laught at me :-((
Posted by IlushaMax 13 Mar 2016 13:20
Because that language hasn't got sort functons? Strange advice to the beginner
Re: My program is wrong and my friends laught at me :-((
Posted by 🎧 Vadim Barinov \Frez_Fstilus/'` 8 Sep 2017 22:31