1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-22 05:26:46 +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;和&nbsp;<code>k</code>,找出所有包含从&nbsp;<code>1</code>&nbsp;到&nbsp;<code>n</code>&nbsp;的数字,且恰好拥有&nbsp;<code>k</code>&nbsp;个逆序对的不同的数组的个数。</p>\n\n<p>逆序对的定义如下:对于数组的第<code>i</code>个和第&nbsp;<code>j</code>个元素,如果满<code>i</code>&nbsp;&lt;&nbsp;<code>j</code>且&nbsp;<code>a[i]</code>&nbsp;&gt;&nbsp;<code>a[j]</code>,则其为一个逆序对;否则不是。</p>\n\n<p>由于答案可能很大,只需要返回 答案 mod 10<sup>9</sup>&nbsp;+ 7 的值。</p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> n = 3, k = 0\n<strong>输出:</strong> 1\n<strong>解释:</strong> \n只有数组 [1,2,3] 包含了从1到3的整数并且正好拥有 0 个逆序对。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong> n = 3, k = 1\n<strong>输出:</strong> 2\n<strong>解释:</strong> \n数组 [1,3,2] 和 [2,1,3] 都有 1 个逆序对。\n</pre>\n\n<p><strong>说明:</strong></p>\n\n<ol>\n\t<li>&nbsp;<code>n</code>&nbsp;的范围是 [1, 1000] 并且 <code>k</code> 的范围是 [0, 1000]。</li>\n</ol>\n",
"isPaidOnly": false,
"difficulty": "Hard",
"likes": 233,
"likes": 236,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -137,7 +137,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"19.4K\", \"totalSubmission\": \"37.4K\", \"totalAcceptedRaw\": 19432, \"totalSubmissionRaw\": 37368, \"acRate\": \"52.0%\"}",
"stats": "{\"totalAccepted\": \"19.6K\", \"totalSubmission\": \"37.8K\", \"totalAcceptedRaw\": 19631, \"totalSubmissionRaw\": 37793, \"acRate\": \"51.9%\"}",
"hints": [],
"solution": null,
"status": null,