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.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
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 and coordinates which gives us our required rectangle.
Time Complexity:
Comments