IOM 2016, Блиц — Задача 51

Olympiad of Metropolises, Moscow. Blitz Contest, September, 5 · 5 септември 2016 г.

Условие

The N-dictionary based on the alphabet a, b, c contains all the words with the number of letters not exceeding N. The words in the dictionary are arranged in the lexicographical way. For instance, if N=2, the words of the dictionary are arranged as follows: a, aa, ab, ac, b, ba, bb, bc, c, ca, cb, cc.

For the given N=4N = 4 define the serial number of the word bbcbbc 4-dictionary. For example in the 2-dictionary the serial number of the word baba is 6, and that for the word cc is 9.

Решение

Внимание: Непълно решение

В архива няма официално решение на тази задача.


Оригинал в Архива: blitz.pdf