Skip to content

Commit cc1fe5b

Browse files
authored
Update minimum-time-to-finish-the-race.cpp
1 parent 4645558 commit cc1fe5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/minimum-time-to-finish-the-race.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Solution {
1515
const int f = tires[i][0], r = tires[i][1];
1616
for (int64_t curr = f, total = f, cnt = 0;
1717
curr < changeTime + f;
18-
curr *= r, total += curr, ++cnt) { // at worst (f, r) = (1, 2) => 2^(cnt-1) < changeTime+1, cnt < ceil(log2(changeTime+1))
18+
curr *= r, total += curr, ++cnt) { // at worst (f, r) = (1, 2) => 2^(cnt-1) < changeTime+1 => cnt < ceil(log2(changeTime+1))
1919
dp[cnt] = min(dp[cnt], total);
2020
}
2121
}

0 commit comments

Comments
 (0)