Competitive Programming Editorials
Stop Reading.
Start Seeing.
Constructive turns competitive programming editorials into interactive, step-by-step visualizations so the solution actually clicks.
Browse Editorials| w=0 | w=1 | w=2 | w=3 | w=4 | w=5 | |
|---|---|---|---|---|---|---|
| i=0 | 0 | 0 | 0 | 0 | 0 | 0 |
| i=1 | 0 | 1 | 1 | 1 | 1 | 1 |
| i=2 | 0 | 1 | 1 | 2 | 2 | 2 |
| i=3 | 0 | 1 | 1 | 2 | 2 | 3 |
| i=4 | 0 | 1 | 2 | 2 | 3 | 3 |
Insight: At dp[3][5], we compare the previous best (2) vs taking item 3. Taking it yields 3, which wins.
Why Constructive
Editorials that actually teach you something.
Algorithm Visualization
Watch DP tables fill, graphs traverse, and arrays sort — synchronized with the exact line of code that drives each step.
The Aha Moment
We walk you through the reasoning — the leap from brute force to the elegant solution — so you can reproduce it on new problems.
Problem First
Each editorial starts with the problem statement and key observations — building context before jumping into code.
LaTeX & Math
Full KaTeX support for recurrences, proofs, and complexity analysis — rendered beautifully inline.
Library
Recent Editorials
A. Cut Ribbon
Codeforces 189A. Maximize the number of ribbon pieces. A quintessential introduction to 1D dynamic programming.
C. Dijkstra?
Codeforces 20C. Find the shortest path from vertex 1 to vertex N and reconstruct the exact path using a priority queue.
E. Xenia and Bit Operations
Codeforces 339D. Maintain alternating bitwise OR and XOR operations on an array under point updates.
Master the patterns behind the hardest problems
Ready to see algorithms differently?
Explore our growing library of visualized editorials — from knapsack to segment trees.
Get Started