46th ICPC World Finals

Problem Y: Compression

Problem authors:
Jakub Onufry Wojtaszczyk and Bob Roos
Solved by 124 teams.
First solved after 6 minutes.
Shortest team solution: 305 bytes.
Shortest judge solution: 108 bytes.

This was inteded to be one of the easiest problems of the contest. The three key properties to notice are that

  1. the first character of the string cannot change,
  2. the last character of the string cannot change, and
  3. it is impossible to erase all occurences of a character.

With this, the set of possible answers for a binary string are narrowed down to strings of length at most 3. This can be achieved by removing characters so all adjacent characters are different, and then removing prefixes of size 2. There is a unique shortest result for all binary strings.