Skip to content

Commit 9749bea

Browse files
Update usaco-104.mdx
1 parent e383c66 commit 9749bea

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

solutions/silver/usaco-104.mdx

+6-7
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,17 @@ title: Haybale Stacking
55
author: Óscar Garries, Brad Ma, KJ Karaisz
66
---
77

8-
<Spoiler title="Hint 1">
8+
<Spoiler title="Hint">
9+
910
Prefix sums consists of an $\mathcal{O}(N)$ preprocess, followed by $\mathcal{O}(1)$ queries.
10-
</Spoiler>
1111

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!
1514

16-
<Spoiler title="Hint 3">
17-
$\mathcal{O}(1)$ *updates*, followed by an $\mathcal{O}(N)$ *post*process.
1815
</Spoiler>
1916

2017
<Spoiler title="Solution">
18+
2119
[Official Analysis (Java)](http://www.usaco.org/current/data/sol_stacking.html)
2220

2321
## Implementation
@@ -124,4 +122,5 @@ print(pref[n // 2])
124122
125123
</PySection>
126124
</LanguageSection>
125+
127126
</Spoiler>

0 commit comments

Comments
 (0)