1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-25 14:58:56 +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>nums</code> 和一个正整数&nbsp;<code>threshold</code> &nbsp;,你需要选择一个正整数作为除数,然后将数组里每个数都除以它,并对除法结果求和。</p>\n\n<p>请你找出能够使上述结果小于等于阈值&nbsp;<code>threshold</code>&nbsp;的除数中 <strong>最小</strong> 的那个。</p>\n\n<p>每个数除以除数后都向上取整,比方说 7/3 = 3 10/2 = 5 。</p>\n\n<p>题目保证一定有解。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,2,5,9], threshold = 6\n<strong>输出:</strong>5\n<strong>解释:</strong>如果除数为 1 ,我们可以得到和为 17 1+2+5+9。\n如果除数为 4 ,我们可以得到和为 7 (1+1+2+3) 。如果除数为 5 ,和为 5 (1+1+1+2)。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [2,3,5,7,11], threshold = 11\n<strong>输出:</strong>3\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [19], threshold = 5\n<strong>输出:</strong>4\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= nums.length &lt;= 5 * 10^4</code></li>\n\t<li><code>1 &lt;= nums[i] &lt;= 10^6</code></li>\n\t<li><code>nums.length &lt;=&nbsp;threshold &lt;= 10^6</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 63,
"likes": 70,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"8.2K\", \"totalSubmission\": \"19.3K\", \"totalAcceptedRaw\": 8212, \"totalSubmissionRaw\": 19257, \"acRate\": \"42.6%\"}",
"stats": "{\"totalAccepted\": \"8.9K\", \"totalSubmission\": \"20.3K\", \"totalAcceptedRaw\": 8883, \"totalSubmissionRaw\": 20279, \"acRate\": \"43.8%\"}",
"hints": [
"Examine every possible number for solution. Choose the largest of them.",
"Use binary search to reduce the time complexity."