Skip to content

Instantly share code, notes, and snippets.

@invatainfo
Created September 4, 2019 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save invatainfo/d05b7e2356b76bd3485e27835ad694cb to your computer and use it in GitHub Desktop.
Save invatainfo/d05b7e2356b76bd3485e27835ad694cb to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main() {
int n, m, i, j, a[21][21];
cin >> m >> n;
for (i = 0; i < m; i++)
for (j = 0; j < n; j++) {
cin >> a[i][j];
}
int symmetric = 1;
for (i = 0; i < m; i++)
for (j = 0; j < (n - 1) / 2; j++) {
if (a[i][j] != a[i][n - j - 1]) {
symmetric = 0;
}
}
if (symmetric == 1)
cout << "DA" << endl;
else
cout << "NU" << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment