File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -5,19 +5,17 @@ title: Haybale Stacking
5
5
author : Óscar Garries, Brad Ma, KJ Karaisz
6
6
---
7
7
8
- <Spoiler title = " Hint 1" >
8
+ <Spoiler title = " Hint" >
9
+
9
10
Prefix sums consists of an $\mathcal{ O } (N)$ preprocess, followed by $\mathcal{ O } (1)$ queries.
10
- </Spoiler >
11
11
12
- <Spoiler title = " Hint 2" >
13
- Now, what's the * opposite* of that?
14
- </Spoiler >
12
+ The reverse of that would be doing $\mathcal{ O } (1)$ * updates* , followed by an $\mathcal{ O } (N)$ * post* process.
13
+ Try to figure out what that might look like in the context of this problem!
15
14
16
- <Spoiler title = " Hint 3" >
17
- $\mathcal{ O } (1)$ * updates* , followed by an $\mathcal{ O } (N)$ * post* process.
18
15
</Spoiler >
19
16
20
17
<Spoiler title = " Solution" >
18
+
21
19
[ Official Analysis (Java)] ( http://www.usaco.org/current/data/sol_stacking.html )
22
20
23
21
## Implementation
@@ -124,4 +122,5 @@ print(pref[n // 2])
124
122
125
123
</PySection>
126
124
</LanguageSection>
125
+
127
126
</Spoiler>
You can’t perform that action at this time.
0 commit comments