mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-27 12:12:01 +00:00
26 lines
489 B
C++
26 lines
489 B
C++
|
#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;
|
||
|
}
|