-->
当前位置:首页 > 题库

PROGRAMMING:The shortest giant

Luz5年前 (2021-05-10)题库375
There are n x n "giants" in the playground. Please program to find out all the "shortest giants" in the matrix.
The so-called "shortest giant" means that the giant is the tallest in his field (no one is taller than him); And in its column, the height of the shortest (no one shorter than it).
###Input format:
The first line of input gives a positive integer n (1 ≤ n ≤ 6), which represents the number of rows and columns of the square matrix. Then n lines, each line gives n integers, representing the giant's height, separated by spaces.
###Output format:
If at least one "dwarf giant" is found, the output is as follows: < br > 1
(subscript of the row of the first dwarf giant, subscript of the column of the first dwarf giant) < br > 1
(the subscript of the second shortest giant in the row and the subscript of the second shortest giant in the column) < br > the number of the second shortest giant in the row is lower than that in the column
...

(the subscript of the row where the nth shortest giant is, and the subscript of the column where the nth shortest giant is) < br > the subscript of the row where the nth shortest giant is
If the "dwarf giant" is not found, the output is as follows:
NONE
Note: even if the output result is only one line, the newline character should be output. Row and column subscripts are counted from 0.
###Input example:
```in
four
1 7 4 6
4 6 3 6
1 6 1 6
0 7 8 7
```
###Output example:
```out
(1,1)
(1,3)
(2,1)
(2,3)
```







answer:If there is no answer, please comment