Aizu 0033
模拟题
照着题意来一遍就好,维护两个最大值
#include <bits/stdc++.h>
using namespace std;
int t;
int main() {
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
cin >> t;
while(t --) {
int l = 0,r = 0,x;
bool flag = 0;
for(int i = 0;i < 10; ++i) {
cin >> x;
int ll = abs(x - l),rr = abs(x - r);
if(x > l && x < r) {
l = x;
}
else if(x > r && x < l) {
r = x;
}
else if(x > l && x > r) {
if(ll < rr) {
l = x;
}
else r = x;
}
else {
cout << "NO
";
flag = 1;
break;
}
}
if(flag) continue;
else cout << "YES
";
}
return 0;
}