← Back to List

20112번: 사토르 마방진 ↗

Solutions

Python 3
177 B | 177 chars
n = int(input())
l = [input() for i in range(n)]

chk = True

for i in range(n):
  for j in range(n):
    if l[i][j] != l[j][i]:
      chk = False

print("YES" if chk else "NO")