Sorting by columns
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
You are given a two-dimensional array with dimensions n x m. Your task is to sort each column in descending order, from top to bottom.
Input
The first line of input consists of two integers, n and m, representing the number of rows and columns, respectively.
The next n lines each contain m integers, which are the elements of the array.
Output
Print the array after sorting each column in descending order.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 48%