G. 最大值和最小值的差 - 作业题

    Type: Default 1000ms 256MiB

最大值和最小值的差 - 作业题

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

问题描述

一次实验后,牛教授想知道最大的实验数据和最小的实验数据相差多少。

输入格式

第一行为M,表示整数个数,整数个数不会大于10000; 第二行为M个整数,以空格隔开,每个整数的绝对值不会大于10000。

输出格式

输出M个数中最大值和最小值的差。

样例输入

5
4 3 5 7 1

样例输出

6

P2阶段测试

Not Attended
Status
Done
Rule
XCPC
Problem
9
Start at
2025-1-24 14:00
End at
2025-1-24 17:00
Duration
3 hour(s)
Host
Partic.
13