Problem G
Superyatzy
Languages
en
sv
Emma loved playing Yatzy when she was younger and recently
decided to try playing it again for the first time in many
years. However, she quickly realized that it was a bit boring
with just five dice, so she changed the rules to include
Emma is using normal 6 sided dice, and wants all dice to show the same value - then she has gotten ”Yatzy” and wins the game.
Input
First, a line containing the numbers
Output
Output ”Ja” if Emma can get Yatzy and ”Nej” otherwise.
Points
Your solution will be tested on different test groups. To score points for a group, you must pass all the test cases in that group.
Group |
Point value |
Constraints |
|
|
|
|
|
|
|
|
At least half the dice show |
|
|
All dice show either |
|
|
No additional constraints. |
Explanation of sample 1:
We receive five dice and can cheat zero times. All dice must be the same for us to achieve Yatzy, but they are not.
Explanation of sample 2:
We receive five dice and can cheat three times. This can be
done by changing the second, third, and fourth dice to
Sample Input 1 | Sample Output 1 |
---|---|
5 0 1 1 1 2 1 |
Nej |
Sample Input 2 | Sample Output 2 |
---|---|
5 3 2 4 4 3 2 |
Ja |
Sample Input 3 | Sample Output 3 |
---|---|
10 5 1 6 1 3 2 6 6 3 6 4 |
Nej |