#abc216b. B - Same Name
B - Same Name
Score : points
问题描述
有 个人。第 个()人的姓氏和名字分别为 和 。
判断是否存在一对人具有相同的姓氏和名字。换句话说,判断是否存在一对整数 满足 ,且 以及 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There are people. The family name and given name of the -th person are and , respectively.
Determine whether there is a pair of people with the same family and given names. In other words, determine whether there is a pair of integers such that , , and .
Constraints
- is an integer.
- Each of and is a string of length between and (inclusive) consisting of English lowercase letters.
Input
Input is given from Standard Input in the following format:
Output
If there is a pair of people with the same family and given names, print Yes
; otherwise, print No
.
Sample Input 1
3
tanaka taro
sato hanako
tanaka taro
Sample Output 1
Yes
The first and third persons have the same family and given names.
Sample Input 2
3
saito ichiro
saito jiro
saito saburo
Sample Output 2
No
No two persons have the same family and given names.
Sample Input 3
4
sypdgidop bkseq
bajsqz hh
ozjekw mcybmtt
qfeysvw dbo
Sample Output 3
No
update @ 2024/3/10 09:34:36