TC CsCourses


 * http://www.topcoder.com/stat?c=problem_statement&pm=7505

Summary
Compute the lexicographically-minimal way to graduate! A relatively straightforward dynamic programming problem with backtracking. A little thinking gets the time down to $$O(n^4)$$ which is enough for $$n=50$$.

From TopCoder Single Round Match 340.