This commit is contained in:
krahets
2023-11-17 00:35:19 +08:00
parent c7794e1a84
commit 5ae2d5e925
17 changed files with 229 additions and 178 deletions
+2 -2
View File
@@ -355,8 +355,8 @@ $$
// 循环贪心选择,直至两板相遇
while (i < j) {
// 更新最大容量
int capacity = MIN(ht[i], ht[j]) * (j - i);
res = MAX(res, capacity);
int capacity = myMin(ht[i], ht[j]) * (j - i);
res = myMax(res, capacity);
// 向内移动短板
if (ht[i] < ht[j]) {
i++;