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

Турниры > CEN112 Questions 2016 > задача:


HW092. 51062 - Fish Pond II

CEN112 Questions 2016

Старт: 30.мар.2016 в 15:10:22
Финиш: 01.апр.2016 в 05:00:00
Турнир завершён!
• Турнирная таблица

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

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

• 15-PE2-3. 50982 - A thief in labyrinth
• 15-PE2-4. 50983 - Course Selection
• 15-PE2-6. 50985 - Books Waiting
• 15-PE2-8. 50987 - Very Looong Queue
• 15-RE-2. 50999 - Overlapping Trips
• 3. 51002 - The most successful classes
• 4. 51003 - Double Prime
• HW092. 51081 - Fish Pond I
• HW092. 51062 - Fish Pond II

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Fish Pond

Question: You work in a fishpond which has a computerized system. The system catches fishes when the fishes pass through a channel. Whenever it takes one fish, it does not have time to take the next fish.

Question: Write a program that defines the max amount to take (max total size) for all the fishes.

Input specification: First you will be given an integer, the number of fish (n). Then, starting from the following line, you will be given n integers (there may be several integers in every line - integers from 1 to 1000) where n is less than 250.

Output specification: Show one integer.

Sample Input I
9
5 3 2 5 5 4 1 3 2
Sample Input II
9
5 1 5 2 4 4 3 2 2
Sample Output I
17
Sample Output II
19

Explanation (Sample Input 1): If fish1 (5), fish4 (5), fish6 (4), and fish8 (3) are taken the max total size (17) are taken. (Sample Input 2): fish 1, 3, 5, 7 and 9 are taken (19).



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

www.contester.ru