Editorial for COCI '19 Contest 5 #1 Emacs
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
The number of rectangles in the image is equal to the number of upper-left corners of rectangles in the image. Cell is an upper-left corner of some rectangle if that cell contains the character *
while cells and (if they exist) contain the character .
.
Alternatively, we can use BFS to find the number of connected components in four general directions which contain the character *
.
Comments