原题 翻译 降智题 用一个前缀和数组\(s_i\)记录前缀中满足\(a_{i-2} \geq a_{i-1} \geq a_i\)的\(i\)的数量 对于区间询问,答案即为\((r-l+1)-(s[r]-s[l+1])\) 因为对于一组\(a_{i-2} \geq a_{i-1} \geq a_i\),我们发现决定条件是否满足的是\(a_{i-1}\)因此,我们只要不选择\(a_{i-1}\)即可本栏目推荐文章CF414B - Mashmokh and ACMCF-613-DCF1201C - Maximum MedianCF1876D LexichromatographyAT_cf17_final_j 题解CF1900E 题解CF1896E 题解CF713D 题解A connection was successfully established with the server but then an errorCF1900E 题解