HBC15815Neat Tree题解

八贝勒 算法基础篇 30 0
不断提升技能,才能在职场中立于不败之地!全网最全C++题库,助您成为编程领域的佼佼者。
It’s universally acknowledged that there’re innumerable trees in the campus of HUST. There is a row of trees along the East-9Road which consists of N trees. Now that we know the height of each tree, the gardeners of HUST want to know the super-neatness of this row of trees. The neatness of asequence of trees is defined as the difference between the maximum height and minimum height in this sequence. The super-neatness of this sequence of treesis defined as the sum of neatness of allcontinous subsequences of the trees. Multiple cases please process until the end of input.There are at most 100 test cases.

It’s universally acknowledged that there’re innumerable trees in the campus of HUST. There is a row of trees along the East-9 Road which consists of N trees. Now that we know the height of each tree, the gardeners of HUST want to know the super-neatness of this row of trees. The neatness of a sequence of trees is defined as the difference between the maximum height and minimum height in this sequence. The super-neatness of this sequence of trees is defined as the sum of neatness of all continous subsequences of the trees. Multiple cases please process until the end of input. There are at most 100 test cases.

HBC15815Neat Tree题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
想要在职场中立于不败之地?那就来试试全网最全C++题库,让您在练习中快速提升技能。

标签: HBC15815Neat Tree题解