minor
This commit is contained in:
parent
53055e79be
commit
6e9f121024
5 changed files with 10 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
slug: /intro/problems
|
slug: /intro/problems
|
||||||
title: Introductory Problems
|
title: Introductory Problems
|
||||||
author: Nathan Wang
|
author: Nathan Wang, Benjamin Qi
|
||||||
problems:
|
problems:
|
||||||
- bronze_promote
|
- bronze_promote
|
||||||
- bronze_word
|
- bronze_word
|
||||||
|
|
|
@ -8,9 +8,7 @@ prerequisites:
|
||||||
- Silver - Containers
|
- Silver - Containers
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="syllabus-only">
|
+ more practice with ordered map / set?
|
||||||
Description: Todo
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- END DESCRIPTION -->
|
<!-- END DESCRIPTION -->
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ prerequisites:
|
||||||
|
|
||||||
- CSES
|
- CSES
|
||||||
- [Sum of Two Values](https://cses.fi/problemset/task/1640)
|
- [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
|
- USACO
|
||||||
- [Silver - Diamond Collector](http://usaco.org/index.php?page=viewproblem2&cpid=643)
|
- [Silver - Diamond Collector](http://usaco.org/index.php?page=viewproblem2&cpid=643)
|
||||||
- sort and then use 2P
|
- sort and then use 2P
|
||||||
|
|
|
@ -5,7 +5,7 @@ author: Eric Wei (incomplete)
|
||||||
order: 6
|
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 -->
|
<!-- END DESCRIPTION -->
|
||||||
|
|
||||||
|
@ -23,6 +23,10 @@ This technique is also known as *cumulative sum* or *partial sums*.
|
||||||
|
|
||||||
## Extensions
|
## Extensions
|
||||||
|
|
||||||
|
### Max Subarray Sum
|
||||||
|
|
||||||
|
[Maximum Subarray Sum](https://cses.fi/problemset/task/1643)
|
||||||
|
|
||||||
### 2D Prefix Sums
|
### 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)$.
|
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)
|
- [CSES Range XOR Queries](https://cses.fi/problemset/task/1650)
|
||||||
|
|
||||||
### More Complex Applications
|
### 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.
|
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)
|
- (find iota ps problem)
|
||||||
|
|
|
@ -8,6 +8,8 @@ prerequisites:
|
||||||
- Gold - Introduction to Dynamic Programming
|
- Gold - Introduction to Dynamic Programming
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<!-- END DESCRIPTION -->
|
||||||
|
|
||||||
## Problems
|
## Problems
|
||||||
|
|
||||||
* [Gold - 248](http://www.usaco.org/index.php?page=viewproblem2&cpid=647)
|
* [Gold - 248](http://www.usaco.org/index.php?page=viewproblem2&cpid=647)
|
||||||
|
|
Reference in a new issue