mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 14:12:17 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个下标从 <strong>0</strong> 开始的二维整数数组 <code>questions</code> ,其中 <code>questions[i] = [points<sub>i</sub>, brainpower<sub>i</sub>]</code> 。</p>\n\n<p>这个数组表示一场考试里的一系列题目,你需要 <strong>按顺序</strong> (也就是从问题 <code>0</code><strong> </strong>开始依次解决),针对每个问题选择 <strong>解决</strong> 或者 <strong>跳过</strong> 操作。解决问题 <code>i</code> 将让你 <b>获得</b> <code>points<sub>i</sub></code> 的分数,但是你将 <strong>无法</strong> 解决接下来的 <code>brainpower<sub>i</sub></code> 个问题(即只能跳过接下来的 <code>brainpower<sub>i</sub></code><sub> </sub>个问题)。如果你跳过问题 <code>i</code> ,你可以对下一个问题决定使用哪种操作。</p>\n\n<ul>\n\t<li>比方说,给你 <code>questions = [[3, 2], [4, 3], [4, 4], [2, 5]]</code> :\n\n\t<ul>\n\t\t<li>如果问题 <code>0</code> 被解决了, 那么你可以获得 <code>3</code> 分,但你不能解决问题 <code>1</code> 和 <code>2</code> 。</li>\n\t\t<li>如果你跳过问题 <code>0</code> ,且解决问题 <code>1</code> ,你将获得 <code>4</code> 分但是不能解决问题 <code>2</code> 和 <code>3</code> 。</li>\n\t</ul>\n\t</li>\n</ul>\n\n<p>请你返回这场考试里你能获得的 <strong>最高</strong> 分数。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><b>输入:</b>questions = [[3,2],[4,3],[4,4],[2,5]]\n<b>输出:</b>5\n<b>解释:</b>解决问题 0 和 3 得到最高分。\n- 解决问题 0 :获得 3 分,但接下来 2 个问题都不能解决。\n- 不能解决问题 1 和 2\n- 解决问题 3 :获得 2 分\n总得分为:3 + 2 = 5 。没有别的办法获得 5 分或者多于 5 分。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><b>输入:</b>questions = [[1,1],[2,2],[3,3],[4,4],[5,5]]\n<b>输出:</b>7\n<b>解释:</b>解决问题 1 和 4 得到最高分。\n- 跳过问题 0\n- 解决问题 1 :获得 2 分,但接下来 2 个问题都不能解决。\n- 不能解决问题 2 和 3\n- 解决问题 4 :获得 5 分\n总得分为:2 + 5 = 7 。没有别的办法获得 7 分或者多于 7 分。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= questions.length <= 10<sup>5</sup></code></li>\n\t<li><code>questions[i].length == 2</code></li>\n\t<li><code>1 <= points<sub>i</sub>, brainpower<sub>i</sub> <= 10<sup>5</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 40,
|
||||
"likes": 43,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"6K\", \"totalSubmission\": \"14.7K\", \"totalAcceptedRaw\": 6012, \"totalSubmissionRaw\": 14689, \"acRate\": \"40.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"6.4K\", \"totalSubmission\": \"15.6K\", \"totalAcceptedRaw\": 6420, \"totalSubmissionRaw\": 15559, \"acRate\": \"41.3%\"}",
|
||||
"hints": [
|
||||
"For each question, we can either solve it or skip it. How can we use Dynamic Programming to decide the most optimal option for each problem?",
|
||||
"We store for each question the maximum points we can earn if we started the exam on that question.",
|
||||
|
Reference in New Issue
Block a user