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

Разделы > Арифметика > задача:


50299 - Median

Задачи раздела

• 50249 - Ladders
• 50247 - Missing numbers
• 50267 - Interesting permutations
• 50640 - Cubes
• 50377 - kth Permutation
• 50341 - Separate Into Digits
• 50424 - Area
• 50335 - Five Math Operators
• 50299 - Median
• 50301 - Fractions to Decimals
• 50304 - Number Pattern
• 50305 - John's Tasks
• 50649 - Puzzle
• 50321 - Missing Number
• 50308 - IT Knowledge Seminars
• 50310 - Kinetic Energy
• 50314 - Falling Distance

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Olimpiada Kombetare 2010. Pergatiti: Evis Hoxha. Сложность Альфа

Median


Given n integer. Write a program that finds a number A in the sequence, such that A has the property that the given amount of numbers that are smaller than A is the same with the given amount of numbers that are bigger than this number A. Also do not forget about the case when this kind of number A can not exist.

Input
First line of input is the number n, where 3<=n<=10 000. Then next n numbers are given in ascending order. Each number is positive.

Output
Show number A if it exists. Otherwise show 0

Input I
5
1 2 3 4 9
Output 1
3

Input II
5
1 2 3 3 3
Output II
0

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

www.contester.ru