From 678743164801a2e66cdfa32f3c6e58402d0d2a9f Mon Sep 17 00:00:00 2001 From: AC_Oier Date: Sun, 20 Mar 2022 09:13:03 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8update:=20Modify=202039?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...10\273\357\274\210\344\270\255\347\255\211\357\274\211.md" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/LeetCode/2031-2040/2039. \347\275\221\347\273\234\347\251\272\351\227\262\347\232\204\346\227\266\345\210\273\357\274\210\344\270\255\347\255\211\357\274\211.md" "b/LeetCode/2031-2040/2039. \347\275\221\347\273\234\347\251\272\351\227\262\347\232\204\346\227\266\345\210\273\357\274\210\344\270\255\347\255\211\357\274\211.md" index 0be1a213..7fb1228f 100644 --- "a/LeetCode/2031-2040/2039. \347\275\221\347\273\234\347\251\272\351\227\262\347\232\204\346\227\266\345\210\273\357\274\210\344\270\255\347\255\211\357\274\211.md" +++ "b/LeetCode/2031-2040/2039. \347\275\221\347\273\234\347\251\272\351\227\262\347\232\204\346\227\266\345\210\273\357\274\210\344\270\255\347\255\211\357\274\211.md" @@ -118,11 +118,11 @@ class Solution { d.addLast(j); } } - int ans = -1; + int ans = 0; for (int i = 1; i < n; i++) { int di = dist[i] * 2, t = patience[i]; int cur = di <= t ? di : (di - 1) / t * t + di; - if (ans == -1 || cur > ans) ans = cur; + if (cur > ans) ans = cur; } return ans + 1; }