Editorial for TLE '17 Contest 3 P1 - Willson and Territory
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:
According to the statement, any real point is in Willson's territory if and only if , where is the maximum value of for some .
Note that this definition is real Manhattan distance. Note that all points in an axis-aligned square that is rotated 45-degree have the same Manhattan distance from the center of that square. Therefore, we simply compute the area of that square, where is the Manhattan distance from to one vertex of the square.
Note that even if Willson takes "infinitely small" horizontal and vertical steps, he is not walking diagonally, due to the laws of mathematics. Therefore, we should not use any form of Euclidean distance.
Time Complexity:
Comments