mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 07:21:40 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>这里有 <code>n</code> 个一样的骰子,每个骰子上都有 <code>k</code> 个面,分别标号为 <code>1</code> 到 <code>k</code> 。</p>\n\n<p>给定三个整数 <code>n</code> , <code>k</code> 和 <code>target</code> ,返回可能的方式(从总共<em> </em><code>k<sup>n</sup></code><em> </em>种方式中)滚动骰子的数量,使正面朝上的数字之和等于<em> </em><code>target</code> 。</p>\n\n<p>答案可能很大,你需要对 <code>10<sup>9</sup> + 7</code> <strong>取模</strong> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 1, k = 6, target = 3\n<strong>输出:</strong>1\n<strong>解释:</strong>你扔一个有6张脸的骰子。\n得到3的和只有一种方法。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 2, k = 6, target = 7\n<strong>输出:</strong>6\n<strong>解释:</strong>你扔两个骰子,每个骰子有6个面。\n得到7的和有6种方法1+6 2+5 3+4 4+3 5+2 6+1。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 30, k = 30, target = 500\n<strong>输出:</strong>222616187\n<strong>解释:</strong>返回的结果必须是对 10<sup>9</sup> + 7 取模。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n, k <= 30</code></li>\n\t<li><code>1 <= target <= 1000</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 126,
|
||||
"likes": 131,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -137,7 +137,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"12.9K\", \"totalSubmission\": \"26.6K\", \"totalAcceptedRaw\": 12918, \"totalSubmissionRaw\": 26550, \"acRate\": \"48.7%\"}",
|
||||
"stats": "{\"totalAccepted\": \"13.5K\", \"totalSubmission\": \"27.7K\", \"totalAcceptedRaw\": 13534, \"totalSubmissionRaw\": 27706, \"acRate\": \"48.8%\"}",
|
||||
"hints": [
|
||||
"Use dynamic programming. The states are how many dice are remaining, and what sum total you have rolled so far."
|
||||
],
|
||||
|
Reference in New Issue
Block a user