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

Сборники > Фёдор Меньшиков. Тренировки > задача:


51194 - The difference between max and min

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

Задачи сборника

• 50812 - Total Discount for the clients
• 50832 - Rock Paper Scissors Lizard ...
• 51078 - Max trade
• 51077 - Grades Histogram
• 51046 - The biggest number
• 50867 - Average of the Best Grades
• Reflektimi i pikes
• 50994 - The Most Crowded Station
• 51194 - The difference between...
• 001. 50385 - From m to n
• 002. 50365 - Sum of the numbers f...
• 002. 50452 - Multiplication Table
• 002. 50554 - Fuqia e n-t e m (2)
• 003. 50387 - Passengers in the Train
• 003. 50358 - Series of Odd Numbers
• 004. 50424 - Area
• 004. 50522 - Multiplication Table - 2

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
bfs.

The difference between max and min.

 

You will be first given one number (n) which is followed by one serie of integers (n space-separated values). Calculate the difference between max and min in the array.

Input specification
You will be given one integers (n) in the first line,   and 1 ≤ n ≤ 10.000. The following line contains a  serie of integer numbers a[n]  where   -10000 ≤ a[n] ≤ 10000.

Output specification
Show the difference between max and min element in the serie.

Sample Input I 
5
3 6 9 5 4

Sample Input II
6
5 8 4 -9 3 2

Sample Output I
6

Sample Output II
17

 

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

www.contester.ru