UVa 10149 - Yahtzee

10149 - Yahtzee

 * [ UVA]
 * Programming Challenges

Summary
Given a set of dice rolls, you must determine the maximum possible score within a game of Yahtzee.

Implementations
Notes/Hints on actual implementation here.

Optimizations
An optimization is required to complete this problem, since enumerating 13! permutations would cause a time limit exceeded error.

Input
1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 1 1 1 1 6 6 6 6 6 6 6 6 1 1 1 1 1 2 2 1 1 1 2 3 1 2 3 4 5 1 2 3 4 6 6 1 2 6 6 1 4 5 5 5 5 5 5 5 6 4 4 4 5 6 3 1 3 6 3 2 2 2 4 6

Output
1 2 3 4 5 0 15 0 0 0 25 35 0 0 90 3 6 9 12 15 30 21 20 26 50 25 35 40 35 327