Editorial for COCI '23 Contest 2 #1 Pahuljice
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.
Prepared by: Martina Licul
Note that each snowflake, regardless of its size, has a +
in the middle. Therefore, there are as many snowflakes as there are +
characters in the drawing.
We want to determine the size of each snowflake and print the largest one.
To do so, we are going to find all the +
characters in the drawing. For each of them, where are going to determine the size of the snowflake it belongs to. We will do that by counting how many corresponding characters there are in each of the eight directions. The size of the snowflake is the smallest of these eight numbers.
Comments