mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-07 08:21:41 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个整数 <code>n</code> ,表示比赛中的队伍数。比赛遵循一种独特的赛制:</p>\n\n<ul>\n\t<li>如果当前队伍数是 <strong>偶数</strong> ,那么每支队伍都会与另一支队伍配对。总共进行 <code>n / 2</code> 场比赛,且产生 <code>n / 2</code> 支队伍进入下一轮。</li>\n\t<li>如果当前队伍数为 <strong>奇数</strong> ,那么将会随机轮空并晋级一支队伍,其余的队伍配对。总共进行 <code>(n - 1) / 2</code> 场比赛,且产生 <code>(n - 1) / 2 + 1</code> 支队伍进入下一轮。</li>\n</ul>\n\n<p>返回在比赛中进行的配对次数,直到决出获胜队伍为止。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>n = 7\n<strong>输出:</strong>6\n<strong>解释:</strong>比赛详情:\n- 第 1 轮:队伍数 = 7 ,配对次数 = 3 ,4 支队伍晋级。\n- 第 2 轮:队伍数 = 4 ,配对次数 = 2 ,2 支队伍晋级。\n- 第 3 轮:队伍数 = 2 ,配对次数 = 1 ,决出 1 支获胜队伍。\n总配对次数 = 3 + 2 + 1 = 6\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>n = 14\n<strong>输出:</strong>13\n<strong>解释:</strong>比赛详情:\n- 第 1 轮:队伍数 = 14 ,配对次数 = 7 ,7 支队伍晋级。\n- 第 2 轮:队伍数 = 7 ,配对次数 = 3 ,4 支队伍晋级。 \n- 第 3 轮:队伍数 = 4 ,配对次数 = 2 ,2 支队伍晋级。\n- 第 4 轮:队伍数 = 2 ,配对次数 = 1 ,决出 1 支获胜队伍。\n总配对次数 = 7 + 3 + 2 + 1 = 13\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 200</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 94,
|
||||
"likes": 97,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"53K\", \"totalSubmission\": \"62.8K\", \"totalAcceptedRaw\": 52987, \"totalSubmissionRaw\": 62822, \"acRate\": \"84.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"53.6K\", \"totalSubmission\": \"63.5K\", \"totalAcceptedRaw\": 53584, \"totalSubmissionRaw\": 63527, \"acRate\": \"84.3%\"}",
|
||||
"hints": [
|
||||
"Simulate the tournament as given in the statement.",
|
||||
"Be careful when handling odd integers."
|
||||
|
Reference in New Issue
Block a user