Editorial for Mock CCC '19 Contest 2 S3 - Tudor Tallies Triangular Totals
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.
To solve the subtask, every line must contain at least two points, but there are possible lines that contain
at least two points, so try all of them. It takes
to check if every point lines on the line, giving
an
algorithm.
For full credit, fix one point and consider all lines that one can draw which go through that point and one other point.
There are only of them - furthermore there is a clear mapping from point to line which needs to be drawn, so
the number of points that lie on every line can be enumerated in
. Remove the point and repeat, for an
algorithm.
Comments