Appearance
Chapter 13 — Worked Solutions
This chapter doesn't teach you algorithms. It teaches you how to think about problems — from the moment you read the statement to the moment you hit Submit. Each file is a full thinking transcript: wrong turns included, insights explained, implementation gotchas highlighted.
These aren't editorials. Editorials tell you the answer. These show you the process of finding it.
Navigation
Coming from: Chapter 12 — Practice Ladders — structured practice from CF 1100 to 2100
Going to: Chapter 14 — Problem Reduction — the meta-skill of transforming unfamiliar problems into familiar ones
Solutions by Technique
The "thinking pattern" column is the transferable move — the reframing or invariant that unlocks the problem. The technique column is the tool that follows once the reframing is in place.
| # | Problem | Thinking pattern | Core technique | Rating | File |
|---|---|---|---|---|---|
| 01 | CF 1691D — Max GEQ Sum | fix the element controlling the max | monotonic stack + sparse table | 1800 | 01-max-geq-sum.md |
| 02 | CF 1474C — Array Destruction | forced largest-element choice | greedy with multiset peel | 1700 | 02-array-destruction.md |
| 03 | CF 1354D — Multiset | bounded values beat ordered sets | binary search on BIT | 1900 | 03-multiset.md |
| 04 | CF 1175E — Minimal Segment Cover | jump structure on intervals | binary lifting | 2000 | 04-minimal-segment-cover.md |
| 05 | CF 1559D2 — Mocha and Diana (Hard) | hub through node 1, then pair across forests | two DSUs | 1900 | 05-mocha-and-diana.md |
| 06 | CF 1536D — Omkar and Medians | check feasibility, do not construct | invariant on a sorted set | 1700 | 06-omkar-and-medians.md |
| 07 | CF 1385E — Directing Edges | orient along a topo order of the directed part | toposort certificate | 1700 | 07-directing-edges.md |
| 08 | CF 1538F — Interesting Function | count each digit position independently | per-place arithmetic | 1800 | 08-interesting-function.md |
| 09 | CF 1443D — Extreme Subtraction | switch to the difference array | monotone decomposition | 1800 | 09-extreme-subtraction.md |
| 10 | CF 1498C — Planar Reflections | state = (mirror, remaining bounces, direction) | DP after collapsing symmetry | 1600 | 10-planar-reflections.md |
How to Use These
These files are deliberate practice, not passive reading. To extract the most:
- Try the problem first. Spend at least 20 minutes on the original statement before opening the file.
- Pause after the "First Read" section. Write down — out loud or on paper — what you would try first and why. Predict the wrong turn before the file shows it.
- Read forward only after committing. Compare each step in the transcript against your written hypothesis. Where did your thinking diverge, and at what cost?
- Extract the thinking pattern. Add the one-line reframing from the table to your mental pattern library. The technique is replaceable; the reframing is what transfers.
If you read the file like a normal editorial, you get the answer but not the training. The pause matters.