Reverse Matrix Diagonals
Здравейте.
Някой, може ли да погледане решението, което сътворих за въпросната задача и да ми каже, защо в judge получавам 20/100.
Решение:
https://pastebin.com/xCmAzAqQ
Условие:
1. Reverse Matrix Diagonals
You are given a matrix (2D array) of integers. You have to print the matrix diagonal but in reversed order. Print each diagonal on new line.
Input
On the first line, single integer the number R of rows in the matrix. On each of the next R lines, C numbers separated by single spaces. Note that R and C may have different values.
Output
The output should consist of R lines, each consisting of exactly C characters, separated by spaces, representing the matrix diagonals reversed.
Constraints
All the integers will be in the range [1….1000].
Examples
Input |
Output |
3 4 21 20 18 15 19 17 14 12 16 13 11 10 |
10 11 12 13 14 15 16 17 18 19 20 21 |
1 3 3 2 1 |
1 2 3 |
3 3 18 17 15 16 14 12 13 11 10 |
10 11 12 13 14 15 16 17 18 |