Editorial for COCI '20 Contest 2 #1 Crtanje
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.
We need to simulate what's written in the statement. The only issue is maintaining the given matrix, because the row index may be negative. One common trick is to add a constant (say, ) to each row index, so that everything is nonnegative and we can use a standard 2-dimensional array.
Comments