Editorial for COCI '06 Contest 6 #3 Maraton


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.

Instead of copy-pasting the checking code 8 times for each of the directions, we can store in an array the row and column components of moving in the 8 directions. We can then use the same block of code to process all 8 directions. This is a common technique in problems on grids where we are required to do something in more than one direction.


Comments

There are no comments at the moment.