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

33 lines
931 B
HTML
Raw Normal View History

2022-03-27 20:46:41 +08:00
<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>