数组13 水桶
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.
问题描述
有n个数,a[1],a[2],…,a[n] 。
(a[i], n<=1,000,000)
求max( min(a[L],a[R])*(R-L))
输入
5
3 2 5 1 1
输出
6
解释
取L=1,R=3, min(3,5)*(3-1)=6
此题拓展题 T183637 变异距离(2021 CoE III C) - 洛谷