Editorial for JDCC '16 Contest 1 P3 - Painting Cost

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.

Author: aurpine

Read the input and store in a 2D array. Then loop through each square of 4 and count the number of unique squares. You can do this easily (but not necessarily efficiently) with a set.

Time Complexity: \mathcal{O}(RC)


There are no comments at the moment.