#abc272b. B - Everyone is Friends
B - Everyone is Friends
Score : points
问题描述
有 名编号为 的人。
共举行了 场聚会。在第 场 聚会中,有 人参加,他们是编号为 的人。
确定是否每两个人至少都曾参加过同一场聚会。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There are people numbered .
parties were held. people attended the -th party, and they were People .
Determine if every two people attended the same party at least once.
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print Yes
if every two people attended the same party at least once; print No
otherwise.
Sample Input 1
3 3
2 1 2
2 2 3
2 1 3
Sample Output 1
Yes
Both Person and Person attended the -st party.
Both Person and Person attended the -nd party.
Both Person and Person attended the -rd party.
Therefore, every two people attended the same party at least once, so the answer is Yes
.
Sample Input 2
4 2
3 1 2 4
3 2 3 4
Sample Output 2
No
Person and Person did not attend the same party, so the answer is No
.
update @ 2024/3/10 11:27:29