Editorial for Yet Another Contest 6 P3 - No More Cell Phone Messaging
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
If
Similarly, if
Subtask 2
If we query at
Similarly, we query at
There are at most two possible sets of positions for Josh and Mike, depending on which diagonal corresponds to which anti-diagonal. We can query at one of the candidate positions to determine the answer. Be careful not to query outside the grid.
Comments