mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 11:21:42 +08:00
add leetcode problem-cn part3
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<p>你的音乐播放器里有 <code>N</code> 首不同的歌,在旅途中,你的旅伴想要听 <code>L</code> 首歌(不一定不同,即,允许歌曲重复)。请你为她按如下规则创建一个播放列表:</p>
|
||||
|
||||
<ul>
|
||||
<li>每首歌至少播放一次。</li>
|
||||
<li>一首歌只有在其他 <code>K</code> 首歌播放完之后才能再次播放。</li>
|
||||
</ul>
|
||||
|
||||
<p>返回可以满足要求的播放列表的数量。<strong>由于答案可能非常大,请返回它模 <code>10^9 + 7</code> 的结果。</strong></p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>N = 3, L = 3, K = 1
|
||||
<strong>输出:</strong>6
|
||||
<strong>解释:</strong>有 6 种可能的播放列表。[1, 2, 3],[1, 3, 2],[2, 1, 3],[2, 3, 1],[3, 1, 2],[3, 2, 1].
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>N = 2, L = 3, K = 0
|
||||
<strong>输出:</strong>6
|
||||
<strong>解释:</strong>有 6 种可能的播放列表。[1, 1, 2],[1, 2, 1],[2, 1, 1],[2, 2, 1],[2, 1, 2],[1, 2, 2]
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>N = 2, L = 3, K = 1
|
||||
<strong>输出:</strong>2
|
||||
<strong>解释:</strong>有 2 种可能的播放列表。[1, 2, 1],[2, 1, 2]
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ol>
|
||||
<li><code>0 <= K < N <= L <= 100</code></li>
|
||||
</ol>
|
Reference in New Issue
Block a user