#abc277b. B - Playing Cards Validation
B - Playing Cards Validation
Score : points
问题描述
你将得到 个长度为 的字符串,每个字符串由大写英文字母和数字组成。第 个字符串为 。
确定以下三个条件是否都得到满足:
- 对于每一个字符串,第一个字符必须是
H、D、C或S中的一个。 - 对于每一个字符串,第二个字符必须是
A、2、3、4、5、6、7、8、9、T、J、Q、K中的一个。 - 所有字符串两两不同。即,如果 ,则 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given strings, each of length , consisting of uppercase English letters and digits. The -th string is .
Determine whether the following three conditions are all satisfied.
・For every string, the first character is one of H, D, C, and S.
・For every string, the second character is one of A, 2, 3, 4, 5, 6, 7, 8, 9, T, J, Q, K.
・All strings are pairwise different. That is, if , then .
Constraints
- is a string of length consisting of uppercase English letters and digits.
Input
The input is given from Standard Input in the following format:
Output
If the three conditions are all satisfied, print Yes; otherwise, print No.
Sample Input 1
4
H3
DA
D3
SK
Sample Output 1
Yes
One can verify that the three conditions are all satisfied.
Sample Input 2
5
H3
DA
CK
H3
S7
Sample Output 2
No
Both and are H3, violating the third condition.
Sample Input 3
4
3H
AD
3D
KS
Sample Output 3
No
Sample Input 4
5
00
AA
XX
YY
ZZ
Sample Output 4
No
update @ 2024/3/10 11:39:08