mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-07 00:11:41 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个下标从 <strong>0</strong> 开始的二维整数数组 <code>tires</code> ,其中 <code>tires[i] = [f<sub>i</sub>, r<sub>i</sub>]</code> 表示第 <code>i</code> 种轮胎如果连续使用,第 <code>x</code> 圈需要耗时 <code>f<sub>i</sub> * r<sub>i</sub><sup>(x-1)</sup></code> 秒。</p>\n\n<ul>\n\t<li>比方说,如果 <code>f<sub>i</sub> = 3</code> 且 <code>r<sub>i</sub> = 2</code> ,且一直使用这种类型的同一条轮胎,那么该轮胎完成第 <code>1</code> 圈赛道耗时 <code>3</code> 秒,完成第 <code>2</code> 圈耗时 <code>3 * 2 = 6</code> 秒,完成第 <code>3</code> 圈耗时 <code>3 * 2<sup>2</sup> = 12</code> 秒,依次类推。</li>\n</ul>\n\n<p>同时给你一个整数 <code>changeTime</code> 和一个整数 <code>numLaps</code> 。</p>\n\n<p>比赛总共包含 <code>numLaps</code> 圈,你可以选择 <strong>任意</strong> 一种轮胎开始比赛。每一种轮胎都有 <strong>无数条</strong> 。每一圈后,你可以选择耗费 <code>changeTime</code> 秒 <strong>换成</strong> 任意一种轮胎(也可以换成当前种类的新轮胎)。</p>\n\n<p>请你返回完成比赛需要耗费的 <strong>最少</strong> 时间。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><b>输入:</b>tires = [[2,3],[3,4]], changeTime = 5, numLaps = 4\n<b>输出:</b>21\n<b>解释:</b>\n第 1 圈:使用轮胎 0 ,耗时 2 秒。\n第 2 圈:继续使用轮胎 0 ,耗时 2 * 3 = 6 秒。\n第 3 圈:耗费 5 秒换一条新的轮胎 0 ,然后耗时 2 秒完成这一圈。\n第 4 圈:继续使用轮胎 0 ,耗时 2 * 3 = 6 秒。\n总耗时 = 2 + 6 + 5 + 2 + 6 = 21 秒。\n完成比赛的最少时间为 21 秒。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><b>输入:</b>tires = [[1,10],[2,2],[3,4]], changeTime = 6, numLaps = 5\n<b>输出:</b>25\n<b>解释:</b>\n第 1 圈:使用轮胎 1 ,耗时 2 秒。\n第 2 圈:继续使用轮胎 1 ,耗时 2 * 2 = 4 秒。\n第 3 圈:耗时 6 秒换一条新的轮胎 1 ,然后耗时 2 秒完成这一圈。\n第 4 圈:继续使用轮胎 1 ,耗时 2 * 2 = 4 秒。\n第 5 圈:耗时 6 秒换成轮胎 0 ,然后耗时 1 秒完成这一圈。\n总耗时 = 2 + 4 + 6 + 2 + 4 + 6 + 1 = 25 秒。\n完成比赛的最少时间为 25 秒。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= tires.length <= 10<sup>5</sup></code></li>\n\t<li><code>tires[i].length == 2</code></li>\n\t<li><code>1 <= f<sub>i</sub>, changeTime <= 10<sup>5</sup></code></li>\n\t<li><code>2 <= r<sub>i</sub> <= 10<sup>5</sup></code></li>\n\t<li><code>1 <= numLaps <= 1000</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 46,
|
||||
"likes": 47,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"3.4K\", \"totalSubmission\": \"8K\", \"totalAcceptedRaw\": 3374, \"totalSubmissionRaw\": 7973, \"acRate\": \"42.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"3.4K\", \"totalSubmission\": \"8.1K\", \"totalAcceptedRaw\": 3423, \"totalSubmissionRaw\": 8104, \"acRate\": \"42.2%\"}",
|
||||
"hints": [
|
||||
"What is the maximum number of times we would want to go around the track without changing tires?",
|
||||
"Can we precompute the minimum time to go around the track x times without changing tires?",
|
||||
|
Reference in New Issue
Block a user