Wednesday, April 9, 2014

SPOJ 6828. Lineup (LINEUP)

http://www.spoj.com/problems/LINEUP/
 By looking at the constraints I can tell that it is enough to just look over all the possible configurations and pick the best one, the hardest problem is the implementation. We can do it recursively with backtracking which means every time we try something we keep our steps so that we can return to some point and continue with other configuration. Check the source code for a good understanding.


       DOWNLOAD THE FULL SOURCE CODE




No comments:

Post a Comment