mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-25 06:48:57 +08:00
存量题库数据更新
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "3201",
|
||||
"questionFrontendId": "100127",
|
||||
"questionFrontendId": "2929",
|
||||
"categoryTitle": "Algorithms",
|
||||
"boundTopicId": 2500653,
|
||||
"title": "Distribute Candies Among Children II",
|
||||
@@ -12,13 +12,32 @@
|
||||
"translatedContent": "<p>给你两个正整数 <code>n</code> 和 <code>limit</code> 。</p>\n\n<p>请你将 <code>n</code> 颗糖果分给 <code>3</code> 位小朋友,确保没有任何小朋友得到超过 <code>limit</code> 颗糖果,请你返回满足此条件下的 <strong>总方案数</strong> 。</p>\n\n<p> </p>\n\n<p><strong class=\"example\">示例 1:</strong></p>\n\n<pre>\n<b>输入:</b>n = 5, limit = 2\n<b>输出:</b>3\n<b>解释:</b>总共有 3 种方法分配 5 颗糖果,且每位小朋友的糖果数不超过 2 :(1, 2, 2) ,(2, 1, 2) 和 (2, 2, 1) 。\n</pre>\n\n<p><strong class=\"example\">示例 2:</strong></p>\n\n<pre>\n<b>输入:</b>n = 3, limit = 3\n<b>输出:</b>10\n<b>解释:</b>总共有 10 种方法分配 3 颗糖果,且每位小朋友的糖果数不超过 3 :(0, 0, 3) ,(0, 1, 2) ,(0, 2, 1) ,(0, 3, 0) ,(1, 0, 2) ,(1, 1, 1) ,(1, 2, 0) ,(2, 0, 1) ,(2, 1, 0) 和 (3, 0, 0) 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 10<sup>6</sup></code></li>\n\t<li><code>1 <= limit <= 10<sup>6</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 2,
|
||||
"likes": 8,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"typescript\": false, \"bash\": false, \"php\": false, \"swift\": false, \"kotlin\": false, \"dart\": false, \"golang\": false, \"ruby\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"rust\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"pythondata\": false, \"react\": false, \"vanillajs\": false, \"postgresql\": false}",
|
||||
"topicTags": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Math",
|
||||
"slug": "math",
|
||||
"translatedName": "数学",
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "Combinatorics",
|
||||
"slug": "combinatorics",
|
||||
"translatedName": "组合数学",
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "Enumeration",
|
||||
"slug": "enumeration",
|
||||
"translatedName": "枚举",
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": [
|
||||
{
|
||||
@@ -136,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"1.7K\", \"totalSubmission\": \"5.4K\", \"totalAcceptedRaw\": 1714, \"totalSubmissionRaw\": 5446, \"acRate\": \"31.5%\"}",
|
||||
"stats": "{\"totalAccepted\": \"2.6K\", \"totalSubmission\": \"7.2K\", \"totalAcceptedRaw\": 2596, \"totalSubmissionRaw\": 7220, \"acRate\": \"36.0%\"}",
|
||||
"hints": [
|
||||
"We can enumerate the number of candies of one particular child, let it be <code>i</code> which means <code>0 <= i <= min(limit, n)</code>.",
|
||||
"Suppose the 2nd child gets <code>j</code> candies. Then <code>0 <= j <= limit</code> and <code>i + j <= n</code>.",
|
||||
|
||||
Reference in New Issue
Block a user