Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f0ba69a

Browse files
Merge pull request SharingSource#422 from SharingSource/ac_oier
✨update: Modify 2039
2 parents 26c83e2 + 6787431 commit f0ba69a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎LeetCode/2031-2040/2039. 网络空闲的时刻(中等).md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ class Solution {
118118
d.addLast(j);
119119
}
120120
}
121-
int ans = -1;
121+
int ans = 0;
122122
for (int i = 1; i < n; i++) {
123123
int di = dist[i] * 2, t = patience[i];
124124
int cur = di <= t ? di : (di - 1) / t * t + di;
125-
if (ans ==-1||cur > ans) ans = cur;
125+
if (cur > ans) ans = cur;
126126
}
127127
return ans + 1;
128128
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /