mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-09 09:21:40 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>请你帮忙给从 <code>1</code> 到 <code>n</code> 的数设计排列方案,使得所有的「质数」都应该被放在「质数索引」(索引从 1 开始)上;你需要返回可能的方案总数。</p>\n\n<p>让我们一起来回顾一下「质数」:质数一定是大于 1 的,并且不能用两个小于它的正整数的乘积来表示。</p>\n\n<p>由于答案可能会很大,所以请你返回答案 <strong>模 mod <code>10^9 + 7</code></strong> 之后的结果即可。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>n = 5\n<strong>输出:</strong>12\n<strong>解释:</strong>举个例子,[1,2,5,4,3] 是一个有效的排列,但 [5,2,3,4,1] 不是,因为在第二种情况里质数 5 被错误地放在索引为 1 的位置上。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>n = 100\n<strong>输出:</strong>682289015\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 100</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 43,
|
||||
"likes": 44,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -137,7 +137,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"8.7K\", \"totalSubmission\": \"17.7K\", \"totalAcceptedRaw\": 8705, \"totalSubmissionRaw\": 17681, \"acRate\": \"49.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"9K\", \"totalSubmission\": \"18.4K\", \"totalAcceptedRaw\": 9029, \"totalSubmissionRaw\": 18359, \"acRate\": \"49.2%\"}",
|
||||
"hints": [
|
||||
"Solve the problem for prime numbers and composite numbers separately.",
|
||||
"Multiply the number of permutations of prime numbers over prime indices with the number of permutations of composite numbers over composite indices.",
|
||||
|
Reference in New Issue
Block a user