Symmetric Matrix
Is the square matrix symmetric (equal to its own transpose)?
Input: the first line has N and N; the next N lines each have N integers.
Output: YES or NO.
Constraints:
- 1 ≤ N ≤ 100
- −104 ≤ values ≤ 104
Sample Tests
Input 1
2 2 1 2 2 1
Output 1
YES
Input 2
2 2 1 2 3 1
Output 2
NO
Discussion (opens after you solve — no spoilers before)
No comments yet.