Editorial for COCI '22 Contest 1 #1 Desni Klik


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.

We need to look at each matrix independently. For each, we have to determine the minimum order number of a row with the character #, and the maximum order number of such row. We can do that with nested loops and helper variables with the currently minimum and maximum order number. We try to update the helper variables every time we are on a field with character #. The needed value for each of the matrices we will get is the difference between the maximum and minimum order number.


Comments

There are no comments at the moment.