数列极差-ybt
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.
Description
在黑板上写了N个正整数作成的一个数列,进行如下操作:每一次擦去其中的两个数a和b,然后在数列中加入一个数a×b+1,如此下去直至黑板上剩下一个数,在所有按这种操作方式最后得到的数中,最大的max,最小的为min,则该数列的极差定义为M=max−min。
Input Format
第一行,一个数为N;
第二行,N个数。
Output Format
输出极差。
3
1 2 3
2
Hint
数据范围:$n \le 100$
2024-12-15贪心训练
- Status
- Done
- Rule
- XCPC
- Problem
- 8
- Start at
- 2024-12-15 13:30
- End at
- 2024-12-15 16:30
- Duration
- 3 hour(s)
- Host
- Partic.
- 6