#abc323b. B - Round-Robin Tournament

B - Round-Robin Tournament

Score : 200200 points

问题描述

NN 名编号为 11NN 的选手进行了一场循环赛。在该循环赛中,每场比赛都有一名选手胜出,另一名选手则会落败。

比赛结果以 NN 个长度均为 NN 的字符串 S1,S2,,SNS_1,S_2,\ldots,S_N 给出,格式如下:

  • iji\neq j,则 SiS_i 的第 jj 个字符为 ox。其中,o 表示选手 ii 击败了选手 jj,而 x 表示选手 ii 输给了选手 jj

  • i=ji=j,则 SiS_i 的第 jj 个字符为 -

获胜场次较多的选手排名更高。若两名选手的胜场数相同,则编号较小的选手排名更高。请按照排名从高到低输出这 NN 名选手的编号。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

There are NN players numbered 11 to NN, 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 NN strings S1,S2,,SNS_1,S_2,\ldots,S_N of length NN each, in the following format:

  • If iji\neq j, the jj-th character of SiS_i is o or x. o means that player ii won against player jj, and x means that player ii lost to player jj.

  • If i=ji=j, the jj-th character of SiS_i 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 NN players in descending order of rank.

Constraints

  • 2N1002\leq N\leq 100
  • NN is an integer.
  • SiS_i is a string of length NN consisting of o, x, and -.
  • S1,,SNS_1,\ldots,S_N conform to the format described in the problem statement.

Input

The input is given from Standard Input in the following format:

NN

S1S_1

S2S_2

\vdots

SNS_N

Output

Print the player numbers of the NN players in descending order of rank.

Sample Input 1

3
-xx
o-x
oo-

Sample Output 1

3 2 1

Player 11 has 00 wins, player 22 has 11 win, and player 33 has 22 wins. Thus, the player numbers in descending order of rank are 3,2,13,2,1.

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 44 and 77 have 55 wins, but player 44 ranks higher because their player number is smaller.

update @ 2024/3/10 01:43:57

}