Light OJ - 1011- Marriage Ceremonies - Tutorial

As n<=16, the problem can be solved with bitmask DP with 2 states. State-1 is for the row(Boy). State-2 is now which column(Girl) is free with bitmasking. Go row by row.
For every row(Boy), check the all available columns(Girl) one by one and calculate the best result. When all the girls have been taken, then the process will be terminated.

Think before you code -_-
Happy Coding -_-

Comments

Trending Post

GCD of all numbers of given range of the array with point update

SPOJ - PARSUMS - Nonnegative Partial Sums with Sliding Range Minimum Query

LeetCode - Single Number III