Created
October 2, 2018 07:10
-
-
Save crazydiver/bf558e8d0429be1901569aa5cb65a9d8 to your computer and use it in GitHub Desktop.
VOSH_20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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