IOM 2017, Блиц — Задача 54

OLYMPIAD OF METROPOLISES. Moscow, September 4 · 4 септември 2017 г.

Условие

In this problem, we want to do the XNX^N operation with the least number of multiplications. We can use only the value of XX and the values we calculated before.

Example for N=5N = 5:

  1. X×X=X2X \times X = X^2
  2. X2×X=X3X^2 \times X = X^3
  3. X3×X2=X5X^3 \times X^2 = X^5

Write the minimal number of multiplications for N=27N = 27.

Отговори

Решение


Оригинал в Архива: blitz.pdf · официални решения: answers-blitz.pdf