Given a square matrix.
$
\left[
\begin{matrix}
a_{11} & a_{12} & \cdots & a_{1n}\\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & \ddots & \vdots \\
a_{n1} & a_{n2} & \cdots & a_{nn}
\end{matrix}
\right]
$
Please check whether it is a symmetric matrix.
A matrix is a symmetric matrix if and only if the main diagonal of the matrix is its axis of symmetry.
The following matrix is a symmetric matrix.
$
\left[
\begin{matrix}
5 & 20 & 8 & 10\\
20 & 8 & 12 & 4\\
8 & 12 & 7 & 11 \\
10 & 4 & 11 & 2
\end{matrix}
\right]
$
First line contains an positive integer $n$, indicates the matrix is $n\times n$.
Following $n$ lines, each line contains $n$ integers. Representing the matrix.
If it is a symmetric matrix, please print Yes
, else print No
.
Note: declare too large array in main function may cause Segmentation Fault.
No. | Testdata Range | Constraints | Score |
---|---|---|---|
1 | 0~4 | $n=2$ | 5 |
2 | 0~9 | $Matrix\ elements\in \{0,1\}$ | 10 |
3 | 0~14 | No specified restriction | 20 |
No. | Time Limit (ms) | Memory Limit (KiB) | Output Limit (KiB) | Subtasks |
---|---|---|---|---|
0 | 1500 | 65536 | 65536 | |
1 | 1500 | 65536 | 65536 | |
2 | 1500 | 65536 | 65536 | |
3 | 1500 | 65536 | 65536 | |
4 | 1500 | 65536 | 65536 | |
5 | 1500 | 65536 | 65536 | |
6 | 1500 | 65536 | 65536 | |
7 | 1500 | 65536 | 65536 | |
8 | 1500 | 65536 | 65536 | |
9 | 1500 | 65536 | 65536 | |
10 | 1500 | 65536 | 65536 | |
11 | 1500 | 65536 | 65536 | |
12 | 1500 | 65536 | 65536 | |
13 | 1500 | 65536 | 65536 | |
14 | 1500 | 65536 | 65536 |