#abc323b. B - Round-Robin Tournament
B - Round-Robin Tournament
Score : points
问题描述
有 名编号为 到 的选手进行了一场循环赛。在该循环赛中,每场比赛都有一名选手胜出,另一名选手则会落败。
比赛结果以 个长度均为 的字符串 给出,格式如下:
-
若 ,则 的第 个字符为
o
或x
。其中,o
表示选手 击败了选手 ,而x
表示选手 输给了选手 。 -
若 ,则 的第 个字符为
-
。
获胜场次较多的选手排名更高。若两名选手的胜场数相同,则编号较小的选手排名更高。请按照排名从高到低输出这 名选手的编号。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There are players numbered to , who have played a round-robin tournament. For every match in this tournament, one player won and the other lost.
The results of the matches are given as strings of length each, in the following format:
-
If , the -th character of is
o
orx
.o
means that player won against player , andx
means that player lost to player . -
If , the -th character of is
-
.
The player with more wins ranks higher. If two players have the same number of wins, the player with the smaller player number ranks higher. Report the player numbers of the players in descending order of rank.
Constraints
- is an integer.
- is a string of length consisting of
o
,x
, and-
. - conform to the format described in the problem statement.
Input
The input is given from Standard Input in the following format:
Output
Print the player numbers of the players in descending order of rank.
Sample Input 1
3
-xx
o-x
oo-
Sample Output 1
3 2 1
Player has wins, player has win, and player has wins. Thus, the player numbers in descending order of rank are .
Sample Input 2
7
-oxoxox
x-xxxox
oo-xoox
xoo-ooo
ooxx-ox
xxxxx-x
oooxoo-
Sample Output 2
4 7 3 1 5 2 6
Both players and have wins, but player ranks higher because their player number is smaller.
update @ 2024/3/10 01:43:57