Re: No subject
program Biatlon;
{$APPTYPE CONSOLE}
uses
SysUtils;
var n,i,j,t,x,z,q1,q2,q3,a,g1,g2,g3,o: integer;
x1,x2: string;
s: array[1..100] of string;
r: array[1..100] of string;
viv: array[1..100] of string;
procedure swap(var x8,y: string);
var t4: string;
begin
t4 := x8;
x8 := y;
y := t4;
end;
begin
g1:=32000;
g2:=61;
g3:=32000;
o:=0;
readln(n);
for i:= 1 to n do
readln(s[i]);
for i:= 1 to n do
begin
t:=Pos(' ',s[i]);
x:=length(s[i]);
r[i]:=Copy(s[i], t+1, 7);
delete(s[i],t,8);
z:=pos(':',s[i]);
x1:=copy(r[i],z+1,2);
x2:=copy(r[i],z+4,4);
val(x1,q1,j);
val(x2,q2,j);
q3:=q1*60+q2;
if q3<g3 then begin g3:=q3; o:=o+1; viv[o]:=s[i]; end;
end;
for j:=1 to o-1 do begin
for i:=1 to o-j do begin
if viv[i] > viv[i+1] then
swap(viv[i],viv[i+1]) end; end;
writeln(o);
for i:=1 to o do
if i=o then write(viv[i]) else
writeln(viv[i]);
readln;
end.
Вот вам решение. 1-ый тест обязано проходить. Но почему-то не проходит.
Edited by author 01.12.2012 22:49