Is the matrix symmetric?

A matrix is called symmetric if the opposite numbers around the main diagonal are equal.
Given an matrix, our task is to find out if the matrix is symmetric.
The first line of the input contains a single integer n. The next n lines contain n integers which represent the matrix.
The output of the program should contain a single line - yes if the matrix is symmetric and no otherwise.
3 0 1 2 1 8 3 2 3 4
3 0 0 0 0 0 0 1 0 1


Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue