Editorial for COCI '11 Contest 3 #1 Digitalna


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.

This problem can be solved by following this algorithm:

  1. Move the arrow down until it's pointing to the BLJTV1 channel.
  2. Move the arrow and selected channel up until they reach the first position.
  3. Move the arrow down until it's pointing to the BLJTV2 channel.
  4. Move the arrow and selected channel up until they reach the second position.

The first two steps are very similar to the other two, and can be implemented using the same function.


Comments

There are no comments at the moment.