HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > IMPC16 Group Contests > problem:


02. 50833 - Min of Odd Positions

IMPC16 Group Contests

Start: Jan.16.2016 at 10:00:00 AM
Finish: Jan.16.2016 at 02:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 01. 50832 - Rock Paper Scissors Liz...
• 02. 50833 - Min of Odd Positions
• 03. 50834 - The train which leaves ...
• 11. 50859 - Low performance
• 12. 50860 - Number of Student Certi...
• 13. 50861 - The largest Student Group
• 14. 50862 - Sum of the Pairs
• 15. 50863 - Total Access Cost of a BST
• 21. 50873 - Max Frequency
• 22. 50874 - Apartment Building Adm...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Min of Odd Positions

Math professor of your brother has given a homework. He has given a series of numbers. And, he is asking the sum of (min of odd positions) and (max of even positions).

Question: Write a program that is going to read n numbers and show the result.

Input specification
In the first line, you will be an integer, the number of numbers (n) where 0 ≤ n ≤ 40,000. Then, in the following n lines, you will be given n integers where the numbers are between -1e8 and +1e8
Note: The number positions goes from 1 to n.

Output specification:
Show the sum of the minimum of odd positions and the maximum of even positions.

Sample Input I
5
14 30 17 26 85
Sample Output I
44

Explanation: There are 3 numbers in odd positions: 14, 17 and 85. And, the min of odd positions is 14. The max of even positions is 30. So, the sum is 44.



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

www.contester.ru