Skip to content

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

Source Type
Competitive Programmer's Handbook Reference
Guide to Competitive Programming Reference
CSES School Excursion Practice

Practice Sources

Source Type
CSES Money Sums Practice

Repo Companion Material

Material Type
Bit-Parallelism / Bitset Optimization hot sheet quick reference
School Excursion note flagship note
Knapsack Family tutorial compare point
FWHT / XOR Convolution / Subset Convolution tutorial compare point
Template Library exact starter route starter route

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