0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-24 16:28:48 +00:00
OI-codes/CodeForces/1604/B/B.cpp

26 lines
489 B
C++
Raw Normal View History

#include <bits/stdc++.h>
using namespace std;
int t, n, a[100005];
int main() {
cin >> t;
while (t--) {
bool flag = false;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
if (n % 2 == 0) {
cout << "YES" << endl;
continue;
}
for (int i = 1; i < n; i++) {
flag = flag || a[i] >= a[i + 1];
}
cout << (flag ? "YES" : "NO") << endl;
}
return 0;
}