Олимпиадные задачи по программированию. Ч. 4. Лучшие решения. Ускова О.Ф - 57 стр.

UptoLike

Составители: 

if k[i1]=y then s:=s+1;
if (s=0)or(k[i]=k[j])or(p>=k[j]-k[i])or((k[i]=k[i-1])and(k[j]-
k[i]<=b[e]))then t1:=false;
y:=y+k[j]-k[i]
until (not t1) or (y>59);
if (not t1) and (j>=n) then f:=false;
j:=j+1;
y:=k[j];
if t1 then
for z:=i to n do
if k[z]=k[i] then
begin
e:=e+1;
a[e]:=p;
b[e]:=k[j-1]-k[i];
end
end
end
end;{osnovnaya}
{Запись в выходной файл}
Procedure peredelka;
var
o1,o2,i,i1,j,t,s,s2:integer;
begin
for i:=1 to e-1 do
for j:=i+1 to e do
if (b[i]>b[j])or((b[i]=b[j])and(a[i]>a[j])) then
begin
o1:=b[i];
o2:=a[i];
b[i]:=b[j];
a[i]:=a[j];
b[j]:=o1;
a[j]:=o2
end;
end;{peredelka}
procedure provorot;
var
i,j,i1,t,s,s2,y:integer;
begin
for i:=1 to e do