Skip to content

Instantly share code, notes, and snippets.

@invatainfo
Created September 4, 2019 18:40
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/cbeb0b44eda35e4d6c5e39bd66f6b857 to your computer and use it in GitHub Desktop.
Save invatainfo/cbeb0b44eda35e4d6c5e39bd66f6b857 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main() {
int n, i, a[21];
cin >> n;
for (i = 0; i < n; i++)
cin >> a[i];
int symmetric = 1;
for (i = 0; i < (n - 1) / 2; i++) {
if (a[i] != a[n - i - 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