Guest User

Untitled

a guest
Sep 19th, 2016
24
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. First Observation : the mst will always be a chain.
  2. Now this problem can be solved using the dp[mask(2^n)][Node(n)][col_of_last_edge(2)] where mask is the bitmask of nodes we've added to the chain, Node is the last node we added to the chain and col_of_last_edge is the color of edge use to connect Node.
RAW Paste Data