Skip to content

Instantly share code, notes, and snippets.

@invatainfo
Created September 4, 2019 18:40
#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