Editorial for DMOPC '18 Contest 2 P1 - Pumpkin Patches

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

Note that for this fence, we only need to consider the leftmost, topmost, rightmost, and bottommost points since the sides must be aligned with the axes. So we can keep a running minimum and maximum of the x and y coordinates which gives us our required rectangle.

Time Complexity: \mathcal{O}(P)


There are no comments at the moment.