Which mask is it?
Warm-up · Multiple choice · about 3 min
Four cities are numbered 0 to 3. Bit k of a mask is 1 when city k is visited, and masks are written with bit 3 on the left. Pick the mask for "cities 0 and 2 are visited, cities 1 and 3 are not".
Learn the idea first: Bitmask DP: TSP and assignments, a visual lesson.
More Bitmask DP: TSP and assignments problems
- Fill the trip table Warm-up
- Shortest path visiting all nodes Standard
- Minimum cost assignment Standard
- Count valid subsets Standard