#4457. Playing Cards Validation

0
    ID: 4457 传统题 2000ms 1024MiB 尝试: 0 已通过: 0 难度: 1 上传者: 标签>AtCoderabc277BGESP 3级枚举(双层循环)字符串

Playing Cards Validation

Playing Cards Validation

题目描述

你被给定了 NN 个字符串,每个长度为 22,由大写英文字母和数字组成。第 ii 个字符串为 SiS_i。
判断下列三个条件是否都满足。
・对于每个字符串,第一个字符是 HH、DD、CC、SS 之一。
・对于每个字符串,第二个字符是 AA、22、33、44、55、66、77、88、99、TT、JJ、QQ、KK 之一。
・所有字符串两两不同。也就是说,如果 i≠ji \neq j,则 Si≠SjS_i \neq S_j。

输入格式

The input is given from Standard Input in the following format: NN S1S_1 S2S_2 ⋮\vdots SNS_N

输出格式

If the three conditions are all satisfied, print YesYes; otherwise, print NoNo.

4
H3
DA
D3
SK
Yes
5
H3
DA
CK
H3
S7
No
4
3H
AD
3D
KS
No
5
00
AA
XX
YY
ZZ
No

提示

1≤N≤521 \leq N \leq 52 SiS_i is a string of length 22 consisting of uppercase English letters and digits.One can verify that the three conditions are all satisfied.
Both S1S_1 and S4S_4 are H3H3, violating the third condition.

标签: AtCoder|abc277B

来源

AtCoder|abc277B