Editorial for Mock CCC '18 Contest 1 J4/S2 - A Square Problem


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: xiaowuc1

Because the input is nicely formatted, checking that the array is a Latin Square reduces to checking that every row and every column has N distinct characters.

Checking for reduced forms just requires checking that the first row and first column are in sorted order.

A few contestants printed reduced without explicitly checking for the Latin square case first.


Comments

There are no comments at the moment.