Skip to content

Commit 5d483de

Browse files
fix some issues
1 parent b9401ed commit 5d483de

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

content/3_Silver/More_Prefix_Sums.mdx

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ frequency: 2
2020
### Solution - Max Subarray Sum
2121

2222
Consider the prefix sum array $p$. The subarray sum $a_i \dots a_{j-1}$, where
23-
$i\leq j$ is $p[j]-p[i]$. Thus, we are looking for the maximum possible value of
24-
$p[j]-p[i]$ over $0 \leq i \leq j \leq N$.
23+
$i < j$ is $p[j]-p[i]$. Thus, we are looking for the maximum possible value of
24+
$p[j]-p[i]$ over $0 \leq i < j \leq N$.
2525

2626
For a fixed right bound $j$, the maximum subarray sum is
2727

2828
$$
29-
p[j]-\min_{i\leq j}{p[i]}
29+
p[j]-\min_{i < j}{p[i]}
3030
$$
3131

32-
Thus, we can keep a running minimum to store $\min\limits_{i\leq j}{p[i]}$ as we
32+
Thus, we can keep a running minimum to store $\min\limits_{i < j}{p[i]}$ as we
3333
iterate through $j$. This yields the maximum subarray sum for each possible
3434
right bound, and the maximum over all these values is our answer.
3535

@@ -66,6 +66,7 @@ int main() {
6666
cout << max_subarray_sum << endl;
6767
}
6868
```
69+
6970
</CPPSection>
7071
<JavaSection>
7172

content/5_Plat/Binary_Jump.problems.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
},
239239
{
240240
"uniqueId": "usaco-901",
241-
"name": "Exercise",
241+
"name": "Exercise Route",
242242
"url": "http://www.usaco.org/index.php?page=viewproblem2&cpid=901",
243243
"source": "Platinum",
244244
"difficulty": "Very Hard",

0 commit comments

Comments
 (0)