diff --git a/content/1_Intro/Intro_Problems.md b/content/1_Intro/Intro_Problems.md index 0c755a9..9b383c6 100644 --- a/content/1_Intro/Intro_Problems.md +++ b/content/1_Intro/Intro_Problems.md @@ -1,7 +1,7 @@ --- slug: /intro/problems title: Introductory Problems -author: Nathan Wang +author: Nathan Wang, Benjamin Qi problems: - bronze_promote - bronze_word diff --git a/content/4_Silver/3_Silver_Sorting.md b/content/4_Silver/3_Silver_Sorting.md index 9044930..761ec78 100644 --- a/content/4_Silver/3_Silver_Sorting.md +++ b/content/4_Silver/3_Silver_Sorting.md @@ -8,9 +8,7 @@ prerequisites: - Silver - Containers --- -
- Description: Todo -
++ more practice with ordered map / set? diff --git a/content/4_Silver/5_Silver_2P.md b/content/4_Silver/5_Silver_2P.md index 9578f65..a0cdfff 100644 --- a/content/4_Silver/5_Silver_2P.md +++ b/content/4_Silver/5_Silver_2P.md @@ -21,7 +21,6 @@ prerequisites: - CSES - [Sum of Two Values](https://cses.fi/problemset/task/1640) - - [Maximum Subarray Sum](https://cses.fi/problemset/task/1643) (<- let's not lump this in w/ two pointers?) - USACO - [Silver - Diamond Collector](http://usaco.org/index.php?page=viewproblem2&cpid=643) - sort and then use 2P diff --git a/content/4_Silver/6_Silver_Psum.md b/content/4_Silver/6_Silver_Psum.md index fe0859d..31af665 100644 --- a/content/4_Silver/6_Silver_Psum.md +++ b/content/4_Silver/6_Silver_Psum.md @@ -5,7 +5,7 @@ author: Eric Wei (incomplete) order: 6 --- -> Given an array of size $N$, answer $Q$ queries of the following form: Find the sum of all elements between indices $i$ and $j$. +> Given an array $A_1,A_2,\ldots,A_N$, answer $Q$ queries of the following form: compute $A_L+A_{L+1}+\cdots+A_R$. @@ -23,6 +23,10 @@ This technique is also known as *cumulative sum* or *partial sums*. ## Extensions +### Max Subarray Sum + +[Maximum Subarray Sum](https://cses.fi/problemset/task/1643) + ### 2D Prefix Sums Given a 2-dimensional array of size $NxM$, answer $Q$ queries of the following form: Find the sum of all elements within the rectangle of indices $(x1,y1)$ to $(x2,y2)$. @@ -46,6 +50,7 @@ On the other hand, XOR is its own inverse operation... - [CSES Range XOR Queries](https://cses.fi/problemset/task/1650) ### More Complex Applications + Instead of storing just the values themselves, you can also take a prefix sum over $i\cdot a_i$, or $10^i \cdot a_i$, for instance. - (find iota ps problem) diff --git a/content/6_Plat/11_DP_Ranges.md b/content/6_Plat/11_DP_Ranges.md index 01815bc..9053df3 100644 --- a/content/6_Plat/11_DP_Ranges.md +++ b/content/6_Plat/11_DP_Ranges.md @@ -8,6 +8,8 @@ prerequisites: - Gold - Introduction to Dynamic Programming --- + + ## Problems * [Gold - 248](http://www.usaco.org/index.php?page=viewproblem2&cpid=647)