Skip to content

Commit 1d839c5

Browse files
Update usaco-923.mdx
1 parent 9749bea commit 1d839c5

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

solutions/silver/usaco-923.mdx

+12-15
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,37 @@
22
id: usaco-923
33
source: USACO Gold 2019 February
44
title: Painting the Barn
5-
authors: Kevin Sheng, KJ Karaisz
5+
author: Kevin Sheng, KJ Karaisz
66
---
77

88
**Note:** This editorial assumes one already has a firm grasp of the
99
[silver](http://www.usaco.org/current/data/sol_paintbarn_silver_feb19.html)
1010
version of this problem.
1111

1212
<Spoiler title="Hint 1">
13-
Think about one rectangle for now.
1413

15-
<Spoiler title="Hint 1.1">
16-
What cells can you ignore?
17-
</Spoiler>
18-
19-
<Spoiler title="Hint 1.2">
20-
What if the problem was one-dimensional?
21-
</Spoiler>
14+
Say FJ could only paint one rectangle of paint over the barn.
15+
Then, this problem would turn into finding the
16+
[maximum sum of a submatrix](https://stackoverflow.com/a/18220549/12128483).
2217

2318
</Spoiler>
2419

2520
<Spoiler title="Hint 2">
21+
2622
So you have your one rectangle now. How do you make this algorithm work for two?
2723

28-
<Spoiler title="Hint 2.1">
29-
You could certainly run the algorithm on another rectangle.
30-
</Spoiler>
24+
Try to think about how you can guarantee disjoint rectangles!
25+
26+
</Spoiler>
27+
28+
<Spoiler title="Answer to Hint 2">
3129

32-
<Spoiler title="Hint 2.2">
33-
*Multiple* rectangles, perhaps?
34-
</Spoiler>
30+
If two rectangles are disjoint, there can always be a horizontal or vertical line separating them.
3531

3632
</Spoiler>
3733

3834
<Spoiler title="Solution">
35+
3936
[Official Analysis (C++)](http://www.usaco.org/current/data/sol_paintbarn_gold_feb19.html)
4037

4138
## Explanation

0 commit comments

Comments
 (0)