Self -information
In information theory and statistics, “surprise” is quantified by self-information. For an event x with probability p(x), the amount of surprise (also called information content) is defined as
I(x)−logp(x)log1p(x).I(x) -\log p(x)\…
lc2104单调栈贡献法 借鉴lc907单调栈分别计算数组所有子数组的最大值之和与最小值之和两者相加(因最小值通过取负转为求最大值)得到所有子数组的极差之和lc907图解 class Solution {public:// 求nums中子数组所有最大值之和long long solver(vector<i…