最小值
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
给定一个包含 个整数的数组 。 该数组中一个区间 ()的值定义为 $\max(A[L],A[L+1],\cdots,A[R])-\min(A[L],A[L+1],\cdots,A[R])$。 求该数组中所有区间值的最小值。
Input Format
第一行输入正整数 。 第二行输入 个整数 ,表示数组中的数。
Output Format
输出所有区间值的最小值。
2
1 3
2
3
1 1 1
0
Hint
样例 3 解释
符合题意的区间为 ,该区间的值为 ,为所有区间中值最小的。
数据规模与规定
对于 分的数据,。
对于 分的数据,。
对于 的数据,,。
2025-11-16周训练
- Status
- Done
- Rule
- XCPC
- Problem
- 7
- Start at
- 2025-11-16 14:15
- End at
- 2025-11-16 17:15
- Duration
- 3 hour(s)
- Host
- Partic.
- 26