Editorial for LCC '23 Contest 1 S3 - Oreos
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:
For the first subtask, you can try splitting each of the oreos to see if it results in a fair split.
Time Complexity:
For the second subtask, notice that splitting one oreo into two cookies and one creme results in an additional two Oreo components. Thus, the parity of and does not change. Performing casework on all four parities of and should result in the answer. Implementation is left as an exercise to the reader.
Time Complexity:
Comments