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

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

Условие

Array A has 15 positive integers indicating the price for visiting a station on a linear road:

{10,5,20,10,30,40,30,30,30,50,100,2,10,3,20}\{10, 5, 20, 10, 30, 40, 30, 30, 30, 50, 100, 2, 10, 3, 20\}

Jerry starts at the first station and he wants to get to the last station in the most inexpensive route. When Jerry is in station ii he has two options: to move to station i+1i+1 or skip it and getting straight to station i+2i+2.

Jerry has to pay for each station he visits. What is the minimal cost for Jerry’s trip including start and finish values? (For example, for array 10 2 9 5 the minimal cost is 17 = 10 + 2 + 5)

Решение

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

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


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