1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/子数组的最小值之和 [sum-of-subarray-minimums].html
2022-03-29 12:43:11 +08:00

33 lines
931 B
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给定一个整数数组 <code>arr</code>,找到 <code>min(b)</code> 的总和,其中 <code>b</code> 的范围为 <code>arr</code> 的每个(连续)子数组。</p>
<p>由于答案可能很大,因此<strong> 返回答案模 <code>10^9 + 7</code></strong></p>
<p> </p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>arr = [3,1,2,4]
<strong>输出:</strong>17
<strong>解释:
</strong>子数组为<strong> </strong>[3][1][2][4][3,1][1,2][2,4][3,1,2][1,2,4][3,1,2,4]。
最小值为 3124112111和为 17。</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>arr = [11,81,94,43,3]
<strong>输出:</strong>444
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 <= arr.length <= 3 * 10<sup>4</sup></code></li>
<li><code>1 <= arr[i] <= 3 * 10<sup>4</sup></code></li>
</ul>
<p> </p>