#abc241g. G - Round Robin
G - Round Robin
Score : points
问题描述
名编号为 至 的选手将参加一场循环赛。
具体来说,对于每一对 ,选手 和选手 之间会进行一次对决,总共进行 场比赛。
在每场比赛中,会有唯一的胜者和败者,不存在平局。
目前已经结束了 场比赛。在第 场比赛中,选手 击败了选手 。
请列出循环赛结束后可能成为唯一冠军的所有选手。
若选手的胜场数严格大于任何其他选手,则称该选手为唯一冠军。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
players numbered through will participate in a round-robin tournament.
Specifically, for every pair , Player and Player play a match against each other once, for a total of matches.
In every match, one of the players will be a winner and the other will be a loser; there is no draw.
matches have already ended. In the -th match, Player won Player .
List all the players who may become the unique winner after the round-robin tournament is completed.
A player is said to be the unique winner if the number of the player's wins is strictly greater than that of any other player.
Constraints
- If , then .
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Let $A=(A_1,A_2,\dots,A_K) (A_1\lt A_2 \lt \dots \lt A_K)$ be the set of indices of players that may become the unique winner. Print in the increasing order, with spaces in between.
In other words, print in the following format.
Sample Input 1
4 2
2 1
2 3
Sample Output 1
2 4
Players and may become the unique winner, while Players and cannot.
Note that output like 4 2
is considered to be incorrect.
Sample Input 2
3 3
1 2
2 3
3 1
Sample Output 2
It is possible that no player can become the unique winner.
Sample Input 3
7 9
6 5
1 2
3 4
5 3
6 2
1 5
3 2
6 4
1 4
Sample Output 3
1 3 6 7
update @ 2024/3/10 10:24:17