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.

【题目描述】

在黑板上写了NN个正整数作成的一个数列,进行如下操作:每一次擦去其中的两个数aabb,然后在数列中加入一个数a×b+1a × b+1,如此下去直至黑板上剩下一个数,在所有按这种操作方式最后得到的数中,最大的maxmax,最小的为minmin,则该数列的极差定义为M=maxminM=max-min

【输入】

第一行,一个数为NN;

第二行,NN个数。

【输出】

输出极差。

【输入样例】

3
1 2 3

【输出样例】

2

【来源】

一本通在线评测

1108

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
8
Start at
2025-11-8 14:00
End at
2025-11-8 17:30
Duration
3.5 hour(s)
Host
Partic.
64