当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6542:SSY and JLBD

题目描述
Mahjong is a board game with a long history. But Mahjong has different rules in different city.

A deck of mahjong consists of 136 cards. It contains 1-9 card in three suits,and Seven kinds of word card("dong","nan","xi","bei",“zhong”,"fa","bai"),there are 4 same cards for each kind of card in a deck of mahjong .

In a mysterious country, the rules of mahjong are very simple.In the game,each Player has 14 cards.There are only two ways people can win the game:



1. shisanyao:You should have all 1 and 9 card in three suits and seven kinds of word card at the same time,and an extra card with any kind of 1 and 9 or word.

2. jiulianbaodeng:Firstly,You should make sure that you have the same suit in your hand.Secondly, for card "1" and card "9",you should have at least three . but for card "2" to card "8",at least one.For example, both "11112345678999" and "11122345678999" can win the game.



Now you know a player's 14 cards. Please judge which card type he can use to win the game.
输入解释
The input file contains 14 lines.Each line has a string representing a card.

For three suits of card "1" to card "9",We use two characters for the type,the first character a is number 1 to 9,and the second character b represents the suit.($a \in \{1,2,3,4,5,6,7,8,9\},b \in \{s,p,w\}$)

For the word cards,as shown in the description,we use full spelling pinyin represent them.
输出解释
If player ‘s card meet the “shisanyao” condition, you should output "shisanyao!".

If player ‘s card meet the “jiulianbaodeng” condition, you should output "jiulianbaodeng!".

Otherwise,you should output "I dont know!".
输入样例
1w
5w
2w
6w
5w
9w
9w
7w
1w
3w
9w
4w
1w
8w
输出样例
jiulianbaodeng!
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6542

最后修改于 2020-10-25T23:32:10+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)