ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > CEN303 2013-15 Questions > задача:


15HW-40. 50676 - Cinema Millennium

CEN303 2013-15 Questions

Старт: 15.дек.2013 в 14:00:00
Финиш: 15.дек.2013 в 19:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (2)

Задачи турнира

• 14-Fall2-50. 50681 - Center of a Series
• 14-FallResit-10. 50525 - Ordering Pizza
• 14-FallResit-20. 50488 - Connecting...
• 15FE-01. 50851 - Repeated Numbers
• 15FE-01. 50838 - Balanced Numbers
• 15FE-04. 50997 - Dynamic Knights
• 15HW-10. 50826 - Olive Containers
• 15HW-30. 50828 - Arranging Time ...
• 15HW-40. 50676 - Cinema Mille...
• 15HW-40. 50829 - Decode an Image
• 15HW-50. 50830 - Sorting BST Nodes
• 15HW-60. 50678 - The Jumping Rabbit
• 15MdE-10. 50802 - Comparing Exams
• 15MdE-20. 50803 - Sum of the dept...
• 15MdE-40. 50805 - Sum of the weig...
• 15PrE-10. 50816 - Largest Sum Path
• 15PrE-20. 50817 - The Knight Move

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
First asked in IMPC14, Question by Ilir Capuni.

Cinema Millennium

Question: Cinema Millennium in Tirana is screening the Frozen -- a movie that recently was awarded Oscar and was rendered by my student N. Sinno. N (1 ≤ N ≤ 10000) people are queued (in an appropriate queue!) in front of the vending counter. It takes T(k) units of time to the k-th person in this line to buy the ticket. However, if the k-th person and k+1-th person buy their ticket together, they will need only P(k) units of time, for k=1, ..., N-1, which may be (but is not necessarily) faster (1≤ T(k), P(k) ≤ 100). Calculate the minimal total time needed for all of them to buy tickets.

Input specification
Number N and arrays T and P.

Output specification
Minimum time required to buy tickets for all the people.

 Sample Input   
 5
 2 3 6 2 1
 2 4 8 6
 Sample Output   
 9


Для отправки решений необходимо выполнить вход.

www.contester.ru