This commit is contained in:
Benjamin Qi 2020-06-09 12:57:44 -04:00
parent 53055e79be
commit 6e9f121024
5 changed files with 10 additions and 6 deletions

View file

@ -1,7 +1,7 @@
---
slug: /intro/problems
title: Introductory Problems
author: Nathan Wang
author: Nathan Wang, Benjamin Qi
problems:
- bronze_promote
- bronze_word

View file

@ -8,9 +8,7 @@ prerequisites:
- Silver - Containers
---
<div class="syllabus-only">
Description: Todo
</div>
+ more practice with ordered map / set?
<!-- END DESCRIPTION -->

View file

@ -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

View file

@ -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$.
<!-- END DESCRIPTION -->
@ -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)

View file

@ -8,6 +8,8 @@ prerequisites:
- Gold - Introduction to Dynamic Programming
---
<!-- END DESCRIPTION -->
## Problems
* [Gold - 248](http://www.usaco.org/index.php?page=viewproblem2&cpid=647)