mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-21 21:16:45 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>有<code> buckets</code> 桶液体,其中 <strong>正好有一桶</strong> 含有毒药,其余装的都是水。它们从外观看起来都一样。为了弄清楚哪只水桶含有毒药,你可以喂一些猪喝,通过观察猪是否会死进行判断。不幸的是,你只有 <code>minutesToTest</code> 分钟时间来确定哪桶液体是有毒的。</p>\n\n<p>喂猪的规则如下:</p>\n\n<ol>\n\t<li>选择若干活猪进行喂养</li>\n\t<li>可以允许小猪同时饮用任意数量的桶中的水,并且该过程不需要时间。</li>\n\t<li>小猪喝完水后,必须有 <code>minutesToDie</code> 分钟的冷却时间。在这段时间里,你只能观察,而不允许继续喂猪。</li>\n\t<li>过了 <code>minutesToDie</code> 分钟后,所有喝到毒药的猪都会死去,其他所有猪都会活下来。</li>\n\t<li>重复这一过程,直到时间用完。</li>\n</ol>\n\n<p>给你桶的数目 <code>buckets</code> ,<code>minutesToDie</code> 和 <code>minutesToTest</code> ,返回 <em>在规定时间内判断哪个桶有毒所需的 <strong>最小</strong> 猪数</em> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>buckets = 1000, minutesToDie = 15, minutesToTest = 60\n<strong>输出:</strong>5\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>buckets = 4, minutesToDie = 15, minutesToTest = 15\n<strong>输出:</strong>2\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>buckets = 4, minutesToDie = 15, minutesToTest = 30\n<strong>输出:</strong>2\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= buckets <= 1000</code></li>\n\t<li><code>1 <= minutesToDie <= minutesToTest <= 100</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 354,
|
||||
"likes": 361,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"24K\", \"totalSubmission\": \"34.4K\", \"totalAcceptedRaw\": 24010, \"totalSubmissionRaw\": 34413, \"acRate\": \"69.8%\"}",
|
||||
"stats": "{\"totalAccepted\": \"24.3K\", \"totalSubmission\": \"34.8K\", \"totalAcceptedRaw\": 24340, \"totalSubmissionRaw\": 34847, \"acRate\": \"69.8%\"}",
|
||||
"hints": [
|
||||
"What if you only have one shot? Eg. 4 buckets, 15 mins to die, and 15 mins to test.",
|
||||
"How many states can we generate with x pigs and T tests?",
|
||||
|
Reference in New Issue
Block a user