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.
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.
No comments:
Post a Comment