Editorial for SAC '22 Code Challenge 4 Junior P3 - Obligatory Triangle Problem
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:
Subtask 1
It suffices to output
Time Complexity:
Subtask 2
For each of the
Declare idx
to be the index of the point with the closest angle currently to
Next, find the difference between
The angle difference can be determined by
If the difference between idx
's angle, set idx
to the current index.
Finally, output idx
.
Time Complexity:
Comments