DP -> Bit-Parallelism / Bitset Optimization
Pack one large boolean DP row into machine words so shift-OR reachability updates run wordwise instead of scalar O(nW) loops.
- Topic slug:
dp/bit-parallelism
- Tutorial page: Open tutorial
- Ladder page: Open ladder
- Repo problems currently tagged here:
1
- Repo companion pages:
5
- Curated external problems:
2
Microtopics
- bitset-dp
- word-packing
- shift-or-reachability
- subset-sum-bitset
- component-size-knapsack
- packed-boolean-state
Learning Sources
Practice Sources
Repo Companion Material
Curated External Problems
Core
| Problem |
Source |
Difficulty |
Context |
Style |
Prerequisites |
Tags |
Why it fits |
| School Excursion |
CSES |
Hard |
Bitset DP |
Dynamic Programming; Implementation; Graph Modeling |
DSU; Boolean DP; Shift-Or Reachability |
Bitset; Reachability; Component Sizes; Subset Sum |
The clean flagship where a light DSU reduction produces one subset-sum reachability row and the intended implementation win is packed bitset shift-OR. |
Stretch
| Problem |
Source |
Difficulty |
Context |
Style |
Prerequisites |
Tags |
Why it fits |
| Money Sums |
CSES |
Easy |
Subset Sum |
Dynamic Programming; Implementation |
Boolean DP; Shift-Or Reachability |
Bitset; Reachable Sums; Boolean DP |
A smaller warm-up where the same packed reachability update is already clean even if ordinary scalar DP still exists. |
Repo Problems
| Code |
Title |
Fit |
Difficulty |
Pattern |
Note |
Solution |
SCHOOLEXCURSION |
School Excursion |
primary |
hard |
- |
Note |
Code |
Regeneration
python3 scripts/generate_problem_catalog.py