---
id: dp-bitmasks
title: "Dynamic Programming on Bitmasks"
author: Michael Cao
prerequisites: 
 - Bit Operations
 - Gold - Introduction to Dynamic Programming
description: DP problems that require iterating over subsets.
frequency: 2
---

import { Problem } from "../models";

export const metadata = {
  problems: {
    general: [
      new Problem("AC", "Matching", "https://atcoder.jp/contests/dp/tasks/dp_o?lang=en", "Intro", false, ["Bitmasks"], ""),
      new Problem("CSES", "Hamiltonian Flights", "1690", "Intro", false, ["Bitmasks"], ""),
      new Problem("CF", "Square Subsets", "contest/895/problem/C", "Easy", false, [], ""),
      new Problem("Kattis", "Cat & Mice", "catandmice", "Normal", false, ["Bitmasks", "Geometry"], ""),
      new Problem("Old Gold", "Moovie Mooving", "515", "Normal", false,[ "Bitmasks"], ""),
      new Problem("CSES", "Elevator Rides", "1653", "Normal", false, ["Bitmasks"], ""),
      new Problem("ojuz", "IZhO Bank", "IZhO14_bank", "Normal", false, ["Bitmasks"], ""),
      new Problem("YS", "Max Indep Set", "maximum_independent_set", "Normal", false, ["Bitmasks", "Meet in Middle"], ""),
    ],
    broken: [
      new Problem("CF", "Guards in the Storehouse", "problemset/problem/845/F", "Normal", false, [], ""),
      new Problem("Plat", "Compound Escape", "949", "Very Hard", false, [], ""),
    ],
  }
};

<info-block title="Pro Tip">

Although this has not been the solution to any platinum problem, you can frequently use this for subtasks.

</info-block>

## Tutorial

<resources>
	<resource source="PAPS" title="9.4"> </resource>
	<resource source="CPH" title="10 (Bit Manipulation), 19.2 (Hamiltonian Paths)"> </resource>
	<resource source="CF" title="DP Over Subsets" url="blog/entry/337"> </resource>
	<resource source="HE" title="DP and Bit Masking" url="https://www.hackerearth.com/practice/algorithms/dynamic-programming/bit-masking/tutorial/"> </resource>
</resources>

## Problems

<problems-list problems={metadata.problems.general} />

## DP on Broken Profile

<resources>
	<resource source="cp-algo" title="DP on Broken Profile" url="dynamic_programming/profile-dynamics.html"> </resource>
</resources>

(fill in? more probs?)

<problems-list problems={metadata.problems.broken} />