Is it possible to calculate the following recurrences in $$$O(N*2^N)$$$.
1) $$$dp[mask] = min(dp[mask] , dp[m_1] + dp[m_2]);$$$
where $$$m_1|m_2 = mask$$$
2) $$$dp[mask] = min(dp[mask] , dp[m_1] + dp[m_2]);$$$
where $$$m_1 \oplus m_2 = mask$$$ and $$$m_1$$$ ,$$$m_2$$$ are subsets of mask.
Auto comment: topic has been updated by ASHWANTH_K (previous revision, new revision, compare).
Isn't the second one the same as the first one?
yeah somewhat
The second one requires m1 and m2 to be disjoint though?
First one is the same as Grouping ..
its $$$3^n$$$ in editorial