mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 15:31:43 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<p>一个厨师收集了他 <code>n</code> 道菜的满意程度 <code>satisfaction</code> ,这个厨师做出每道菜的时间都是 1 单位时间。</p>
|
||||
|
||||
<p>一道菜的 「喜爱时间」系数定义为烹饪这道菜以及之前每道菜所花费的时间乘以这道菜的满意程度,也就是 <code>time[i]</code>*<code>satisfaction[i]</code> 。</p>
|
||||
<p>一道菜的 「 <strong>like-time 系数 </strong>」定义为烹饪这道菜结束的时间(包含之前每道菜所花费的时间)乘以这道菜的满意程度,也就是 <code>time[i]</code>*<code>satisfaction[i]</code> 。</p>
|
||||
|
||||
<p>请你返回做完所有菜 「喜爱时间」总和的最大值为多少。</p>
|
||||
<p>返回厨师在准备了一定数量的菜肴后可以获得的最大 <strong>like-time 系数</strong> 总和。</p>
|
||||
|
||||
<p>你可以按 <strong>任意</strong> 顺序安排做菜的顺序,你也可以选择放弃做某些菜来获得更大的总和。</p>
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
<pre>
|
||||
<strong>输入:</strong>satisfaction = [-1,-8,0,5,-9]
|
||||
<strong>输出:</strong>14
|
||||
<strong>解释:</strong>去掉第二道和最后一道菜,最大的喜爱时间系数和为 (-1*1 + 0*2 + 5*3 = 14) 。每道菜都需要花费 1 单位时间完成。</pre>
|
||||
<strong>解释:</strong>去掉第二道和最后一道菜,最大的 like-time 系数和为 (-1*1 + 0*2 + 5*3 = 14) 。每道菜都需要花费 1 单位时间完成。</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>satisfaction = [4,3,2]
|
||||
<strong>输出:</strong>20
|
||||
<strong>解释:</strong>按照原来顺序相反的时间做菜 (2*1 + 3*2 + 4*3 = 20)
|
||||
<strong>解释:可以</strong>按照任意顺序做菜 (2*1 + 3*2 + 4*3 = 20)
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
@@ -28,7 +28,7 @@
|
||||
<pre>
|
||||
<strong>输入:</strong>satisfaction = [-1,-4,-5]
|
||||
<strong>输出:</strong>0
|
||||
<strong>解释:</strong>大家都不喜欢这些菜,所以不做任何菜可以获得最大的喜爱时间系数。
|
||||
<strong>解释:</strong>大家都不喜欢这些菜,所以不做任何菜就可以获得最大的 like-time 系数。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
Reference in New Issue
Block a user