Editorial for COCI '06 Regional #4 Circle
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.
The first step in solving this problem is to simulate the described transformation times in order to obtain Stanko's final circle.
The reverse transformation is not unique, but there are at most two different circles that, when transformed, yield any given circle – if we fix or as one of the pebbles, the rest are determined uniquely.
Therefore there are at most different possible starting circles. Since is small enough, we can check all of these and remove any duplicates.
Comments