HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > SEM 2 - W2 > problem:


51194 - The difference between max and min

SEM 2 - W2

Start: Mar.14.2023 at 12:01:33 AM
Finish: Mar.20.2023 at 08:01:33 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (4)

Contest problems

• 51194 - The difference between...
• 51196 - The sum of two arrays
• 15-PE-6. 50870 - ZScore normalization
• 2013-01-20. 50331 - Number of Nu...

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.
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