1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-21 21:16:45 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>有一个书店老板,他的书店开了&nbsp;<code>n</code>&nbsp;分钟。每分钟都有一些顾客进入这家商店。给定一个长度为 <code>n</code> 的整数数组 <code>customers</code> ,其中 <code>customers[i]</code> 是在第 <code>i</code> 分钟开始时进入商店的顾客的编号,所有这些顾客在第 <code>i</code> 分钟结束后离开。</p>\n\n<p>在某些时候,书店老板会生气。 如果书店老板在第 <code>i</code> 分钟生气,那么 <code>grumpy[i] = 1</code>,否则 <code>grumpy[i] = 0</code>。</p>\n\n<p>当书店老板生气时,那一分钟的顾客就会不满意,若老板不生气则顾客是满意的。</p>\n\n<p>书店老板知道一个秘密技巧,能抑制自己的情绪,可以让自己连续&nbsp;<code>minutes</code>&nbsp;分钟不生气,但却只能使用一次。</p>\n\n<p>请你返回 <em>这一天营业下来,最多有多少客户能够感到满意</em> 。<br />\n&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>customers = [1,0,1,2,1,1,7,5], grumpy = [0,1,0,1,0,1,0,1], minutes = 3\n<strong>输出:</strong>16\n<strong>解释:</strong>书店老板在最后 3 分钟保持冷静。\n感到满意的最大客户数量 = 1 + 1 + 1 + 1 + 7 + 5 = 16.\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>customers = [1], grumpy = [0], minutes = 1\n<strong>输出:</strong>1</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>n == customers.length == grumpy.length</code></li>\n\t<li><code>1 &lt;= minutes &lt;= n &lt;= 2 * 10<sup>4</sup></code></li>\n\t<li><code>0 &lt;= customers[i] &lt;= 1000</code></li>\n\t<li><code>grumpy[i] == 0 or 1</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 214,
"likes": 218,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"52.6K\", \"totalSubmission\": \"90.5K\", \"totalAcceptedRaw\": 52608, \"totalSubmissionRaw\": 90473, \"acRate\": \"58.1%\"}",
"stats": "{\"totalAccepted\": \"53.3K\", \"totalSubmission\": \"91.7K\", \"totalAcceptedRaw\": 53326, \"totalSubmissionRaw\": 91738, \"acRate\": \"58.1%\"}",
"hints": [
"Say the store owner uses their power in minute 1 to X and we have some answer A. If they instead use their power from minute 2 to X+1, we only have to use data from minutes 1, 2, X and X+1 to update our answer A."
],