Code:
PROGRAM BICIKLISTI;
VAR
POZ :array[1..10000] of integer;
TAK :array[1..10000] of integer;
BRT :integer;
BRP :longint;
SWAP,P,i:integer;
PROCEDURE MAIN;
VAR
fi :text;
fo :text;
PROCEDURE SETUP;
BEGIN
for i:=1 to BRT do begin
POZ[i]:=i;
TAK[i]:=i;
end;
END;
BEGIN
assign(fi,'biciklisti.dat');
reset(fi);
read(fi,BRT);
readln(fi,BRP);
SETUP;
for i:=1 to BRP do begin
readln(fi,P);
SWAP:=TAK[POZ[P]-1];
TAK[POZ[P]-1]:=P;
TAK[POZ[P]]:=SWAP;
dec(POZ[P]);
inc(POZ[POZ[P]]);
end;
close(fi);
assign(fo,'biciklisti.res');
rewrite(fo);
for i:=1 to BRP+1 do writeln(fo,TAK[i]);
close(fo);
END;
BEGIN
MAIN;
END.
And don't be mad at me for crying for humanity,
call it pretensions but I got good intentions,
to keep my sanity, I'm hoping, fuck, there's gotta be
an answer to their strategies and their evil inventions... ~Looptroop