Skip to content

Instantly share code, notes, and snippets.

@crazydiver
Created October 2, 2018 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crazydiver/bf558e8d0429be1901569aa5cb65a9d8 to your computer and use it in GitHub Desktop.
Save crazydiver/bf558e8d0429be1901569aa5cb65a9d8 to your computer and use it in GitHub Desktop.
VOSH_20
var
i, n, Place, lth, maxLth :longint;
room : array[1..9] of boolean;
begin
for i:=1 to 9 do
room[i]:=true;
readln (n);
for i:=1 to n do
begin
read (Place);
if Place<=36 then
room[(Place-1) div 4 + 1]:=false
else
room[(54-Place) div 2 + 1]:=false;
end;
lth:=0;
maxLth:=0;
for i:=1 to 9 do
if room[i] then
Lth+=1
else
begin
if Lth<Lth then
maxLth:=Lth;
lth:=0;
end;
writeln (maxLth);
end.
//5 6 3 4 8 7 51 9 10 54 49 52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment