UVa 10149

From Algorithmist
Jump to navigation Jump to search

10149 - Yahtzee[edit]

Summary[edit]

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

Explanation[edit]

Gotchas[edit]

Notes[edit]

Implementations[edit]

Notes/Hints on actual implementation here.

Optimizations[edit]

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

Input[edit]

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[edit]

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

References[edit]

  1. Reference 1

Categories here, use the form [[Category:UVa Online Judge|10149]] [[Category: Category Name]], see Categories for a list