304886: CF928A. Login Verification
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Login Verification
题意翻译
**题目描述:** 登录名是由小写和大写拉丁字母、数字和下划线符号“_”组成的任意序列。 如果登录名与已经存在的登录名类似,则禁止注册。 如果我们可以通过以下类型的操作组成的序列将S转化成T,则认为S,T是类似的。 - 将小写字母转换为大写字母,将大写字母转换为小写字母 - 将字母“O”更改为数字“0”,将数字“0”更改为字母“O” - "1""l""L"相互转化 例如, 登录名«codeforces»和«codefwrces», «oo0oo00oo0oo0oo0oo_lol»和«oo0oo0oo0oo0oo0oo0oo0oo0oo_1oo»是类似的, 而«codeforces»和«code_forces»则不是。 给你一个登录名的列表,其中没有两个类似的登录名。 检查新登录名是否和已有登录名类似。 ------------ **输入格式:** 第一行包括一个非空字符串s(新登录名),由小写和大写拉丁字母、数字和下划线符号_组成,长度不超过50。 第二行是一个整数n,1<=n<=1000——已有登录名的数目 接下来有n行,每行一个已有登录名。 保证没有两个已有的登录是类似的 ------------ **输出格式:** 如果登录名合法(不与已有登录名类似),输出Yes。 否则输出No题目描述
When registering in a social network, users are allowed to create their own convenient login to make it easier to share contacts, print it on business cards, etc. Login is an arbitrary sequence of lower and uppercase latin letters, digits and underline symbols («\_»). However, in order to decrease the number of frauds and user-inattention related issues, it is prohibited to register a login if it is similar with an already existing login. More precisely, two logins $ s $ and $ t $ are considered similar if we can transform $ s $ to $ t $ via a sequence of operations of the following types: - transform lowercase letters to uppercase and vice versa; - change letter «O» (uppercase latin letter) to digit «0» and vice versa; - change digit «1» (one) to any letter among «l» (lowercase latin «L»), «I» (uppercase latin «i») and vice versa, or change one of these letters to other. For example, logins «Codeforces» and «codef0rces» as well as «OO0OOO00O0OOO0O00OOO0OO\_lol» and «OO0OOO0O00OOO0O00OO0OOO\_1oI» are considered similar whereas «Codeforces» and «Code\_forces» are not. You're given a list of existing logins with no two similar amonst and a newly created user login. Check whether this new login is similar with any of the existing ones.输入输出格式
输入格式
The first line contains a non-empty string $ s $ consisting of lower and uppercase latin letters, digits and underline symbols («\_») with length not exceeding $ 50 $ — the login itself. The second line contains a single integer $ n $ ( $ 1<=n<=1000 $ ) — the number of existing logins. The next $ n $ lines describe the existing logins, following the same constraints as the user login (refer to the first line of the input). It's guaranteed that no two existing logins are similar.
输出格式
Print «Yes» (without quotes), if user can register via this login, i.e. none of the existing logins is similar with it. Otherwise print «No» (without quotes).
输入输出样例
输入样例 #1
1_wat
2
2_wat
wat_1
输出样例 #1
Yes
输入样例 #2
000
3
00
ooA
oOo
输出样例 #2
No
输入样例 #3
_i_
3
__i_
_1_
I
输出样例 #3
No
输入样例 #4
La0
3
2a0
La1
1a0
输出样例 #4
No
输入样例 #5
abc
1
aBc
输出样例 #5
No
输入样例 #6
0Lil
2
LIL0
0Ril
输出样例 #6
Yes