#P8466. [Aya Round 1 A] 幻想乡扑克游戏
[Aya Round 1 A] 幻想乡扑克游戏
Background
After the Ability Card Incident, the girls of Gensokyo collected the extra cards and, imitating an outside game called “Dou Dizhu” (Dou Dizhu), played happily.
Problem Description
Dou Dizhu is a game played with a total of poker cards: to plus the small joker and the big joker. There is one small joker and one big joker, and for each other rank there are four cards. In Dou Dizhu, the order of card ranks is as follows:
$$\tt 3<4<5<6<7<8<9<10<J<Q<K<A<2<\stackrel{\mathclap{\color{white}\textbf{\textit{wxy}}}}{\text{小王}} < \text{大王}$$Also, the rank order is unrelated to suits.
At the start of the game, players are each dealt cards as their hand, and the remaining three cards become the bottom cards. Players will sort their cards from high to low, and then decide whether to call landlord based on how good their hand is.
You think that if your hand contains a “rocket” (i.e., one small joker and one big joker) or at least one “bomb” (i.e., four cards of the same rank), then you will choose to call landlord.
Please write a program to determine whether you should call landlord.
Input Format
This problem contains multiple test cases.
- The first line contains an integer , the number of test cases.
- The next lines each contain a string of length , representing your hand. It is guaranteed that the cards have already been sorted. In the input, represents a card of rank , represents the small joker, and represents the big joker.
Output Format
- Output lines in total.
- For each test case, output one string per line:
yesmeans you should call landlord.nomeans you should not call landlord.
- You may output the string in any letter case. For example,
yes,Yes, andYESare all accepted as meaning you should call landlord.
3
X2AAKKKKQT9765433
DX22AKKQJTT884443
X2AAAKQQJT8554433
Yes
Yes
No
Hint
Sample Explanation
For test case , the input corresponds to the following hand (ignoring suits):
There is a bomb in this hand:
So you choose to call landlord.
For test case , the input corresponds to the following hand (ignoring suits):
There is a rocket in this hand:
So you choose to call landlord.
For test case , the input corresponds to the following hand (ignoring suits):
There is no rocket and no bomb in this hand. So you choose not to call landlord.
Constraints and Notes
For of the testdata, . It is guaranteed that the cards have already been sorted.
Translated by ChatGPT 5




