41 lines
693 B
C++
41 lines
693 B
C++
#include <iostream>
|
|
#include <vector>
|
|
|
|
using namespace std;
|
|
|
|
void min_maxer(vector<int> &_a, vector<int> &pre, vector<int> &stu,
|
|
vector<bool> &map) {
|
|
int n = _a.size();
|
|
map[0] = true;
|
|
map[n - 1] = true;
|
|
|
|
for (int i = 1; i < n; i++) {
|
|
if (_a[i] < _a[i - 1])
|
|
map[i] = true;
|
|
if (_a[n - i - 1] < _a[n - i - 2])
|
|
map[i] = true;
|
|
}
|
|
}
|
|
|
|
void solve() {
|
|
int n;
|
|
cin >> n;
|
|
vector<int> a(n);
|
|
for (auto &i : a)
|
|
cin >> i;
|
|
|
|
vector<int> min_prefix(n), max_stufix(n);
|
|
vector<bool> map(n);
|
|
min_maxer(a, min_prefix, max_stufix, map);
|
|
for (auto i : map)
|
|
cout << i;
|
|
cout << "\n";
|
|
}
|
|
|
|
int main() {
|
|
int t;
|
|
cin >> t;
|
|
while (t--)
|
|
solve();
|
|
}
|