HBC200602Max Sum题解

一点都不欢乐 算法基础篇 55 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
to be the weight of interval [L, R]. For each position i , hery defines interval [L, R] as a wonderful interval of i if:. is the max weight of all wonderful intervals of i. Hery wants to know the

Hery has two arrays a and k with n integers. Let sum_{i=L}^R{a_i} ∑ i=L R ​ a i ​ to be the weight of interval [L, R]. For each position i (1 ≤ i ≤ n), hery defines interval [L, R] as a wonderful interval of i if: • 1 ≤ L ≤ R ≤ n • 0 ≤ i − L, R − i ≤ k_i 0≤i−L,R−i≤k i ​ . For each i from 1 to n, s_i s i ​ is the max weight of all wonderful intervals of i. Hery wants to know the value of: sum_{i=1}^n{s_i} ∑ i=1 n ​ s i ​ .

HBC200602Max Sum题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断学习,不断挑战,才能在编程领域中脱颖而出!全网最全C++题库,助您成为编程高手!

标签: HBC200602Max Sum题解