Data Structures & AlgorithmsModerateCodeforces Div2 B · bitmask
Problem: How many states does a bitmask DP over subsets of n = 15 items have?
- A. 15! states
- B. 15^2 states
- C. 2^15 = 32768
- D. 2 * 15 states
Correct answer: C. 2^15 = 32768
Each subset is one state, so there are 2^n = 32768 states for n = 15.
More Coding Interview Problems questions
- Problem: Which statement about the Floyd-Warshall algorithm's memory usage for V vertices is correct?
- Problem: Which problem asks for the minimum number of edges to add to make a graph 2-edge-connected?
- Problem: What does 'lazy propagation' in a segment tree guarantee for a range-add update?
- Problem: Which result is the basis of Mo's algorithm's complexity analysis?
- Problem: What is the expected number of comparisons of randomised quicksort on n distinct elements?
- Problem: Which property does the 'exchange argument' prove for an optimal greedy algorithm?