- St. Petersburg University of IT
- University of Warsaw
- Moscow University of Physics and Technology
- Shanghai Jiao Tong University
The problems can be found here.
In this problem, we deal with stacks of plates that behave like disks in the Towers of Hanoi puzzle. A plate can be put on top of another plate, whose diameter is not smaller. Unlike in the famous puzzle, there is no limit on the number of stacks of plates.
In a single move, we can take some plates from a stack and put them aside (split), or put one stack on top of another stack (join). It is not possible to move directly some plates from top of one stack to some other stack &emdash; one has to make two moves: split and join.
Given \(m\) stacks of plates, we are looking for a minimum number of moves needed to merge them into a single stack.
This task is quite easy. Looking at the statistics, it is the fifth most solved task. Why the fifth? Maybe because K is not at the beginning of the alphabet ...
It can be solved in a greedy manner. Think about the largest plate. It is at the bottom of some stack. Let us say, that \(k\) bottom stacks from this stack are larger or equal than all the other plates. So, these \(k\) plates can be put at the very bottom of the final stack. The problem reduces to a smaller one. This way, we can find the minimal set of stacks into which we have to split the original stacks. Finally, we should join all the stacks into a single stack.
In a way, it is just merging \(m\) sorted sequences into one sorted sequence, by moving minimum number of segments of elements.
Fibonacci words are strings, that are defined in a recursive way, similarly to Fibonacci numbers.
\(F(0) = 0\), \(F(1) = 1\), \(F(n) = F(n-1)\cdot F(n-2)\), where \(\cdot\) denotes string concatenation.
Here are a few first Fibonacci words:
0
1
10
101
10110
10110101
Given a sequence of bits \(p\) and an integer \(n)\, the task is to compute the number of occurrences of \(p\) in \(F(n)\).
Fibonacci words have been intensively studied in computer-science. Now wonder, the problem of finding patterns in Fibonacci words already has been considered. A similar, or even more difficult, problem has appeared in Polish OI, http://main.edu.pl/en/archive/oi/16/slw.