Skip to content

Commit e4e121e

Browse files
committed
APIO Rainbow + USACO Hill Walk
1 parent 92170a9 commit e4e121e

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

content/5_Plat/Sweep_Line.mdx

+9
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ export const problems = {
3434
),
3535
],
3636
seg: [
37+
new Problem(
38+
'Old Gold',
39+
'Hill Walk',
40+
'266',
41+
'Normal',
42+
false,
43+
[],
44+
''
45+
),
3746
new Problem(
3847
'CEOI',
3948
'Roads',

solutions/APIO 17-rainbow.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ To find $E$, $V$, and $R$, we can use a data structure that can handle 2D range
4141

4242
However, the coordinates of the grid can get very large, so a simple 2D BIT or segment tree won't work here.
4343

44-
To work around this, we can either use a 2D BIT with coordinate compression or a persistent segment tree. See [the section on offline 2D sum queries](/plat/2DRQ#2d-offline-sum-queries) for more details.
44+
To work around this, we can either use a 2D BIT with coordinate compression or a persistent segment tree. See the sections on [offline 2D sum queries](/plat/2DRQ#2d-offline-sum-queries) or [persistent segment trees](https://usaco.guide/adv/persistent) for more details.
4545

46-
## Complexity
46+
## Code
4747

48-
Time: $O(N \log^2 N)$.
48+
With a persistent segment tree.
4949

50-
Memory: $O(N \log N)$.
50+
**Time:** $\mathcal{O}(N \log N)$
5151

52-
## Code
52+
**Memory:** $\mathcal{O}(N \log N)$
5353

5454
```cpp
5555
#include "rainbow.h"

0 commit comments

Comments
 (0)