t = int(input())
for _ in range(t):
n = int(input())
arr = list(map(int, input().split()))
pos = [0] * (n + 1)
for i, e in enumerate(arr):
pos[e] = i
l = n
r = -1
for i in range(1, n+1):
l = min(l, pos[i])
r = max(r, pos[i])
if r - l + 1 == i:
print('1', end='')
else:
print('0', end='')
print()
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define Max INT_MAX
#define Min INT_MIN
#define in(a) cin >> a
#define inn(a, b) cin >> a >> b
#define innn(a, b, c) cin >> a >> b >> c
#define fwl(i, a, b) for (int i = a; i < b; i = i + 1)
#define bwl(i, a, b) for (int i = a; i >= b; i = i - 1)
#define invec(a, n) fwl(i, 0, n) cin >> a[i]
#define autol(x, a) for (auto &x : a)
#define all(v) (v.begin(), v.end())
#define vi vector<int>
#define vl vector<long long>
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define vs vector<string>
#define pb push_back
#define ppb pop_back
#define pii pair<int, int>
#define vpii vector<pii>
#define makp make_pair
#define unmapii unordered_map<int, int>
#define mapii map<int, int>
#define unsi unordered_set<int>
#define si set<int>
#define ff first
#define ss second
void primeFactors(int n, vi pf)
{
while (n % 2 == 0)
{
pf.pb(2);
n = n / 2;
}
for (int i = 3; i <= sqrt(n); i = i + 2)
{
while (n % i == 0)
{
pf.pb(i);
n = n / i;
}
}
if (n > 2)
pf.pb(n);
}
ll fact(int n)
{
ll p = 1;
for (ll i = 1; i <= n; i++)
p *= i;
return p;
}
ll lcm(ll a, ll b)
{
return (a * b) / __gcd(a, b);
}
int fastpower(int a, int b, int m)
{
if (b == 1)
return a % m;
if (b % 2 == 0)
{
int t = fastpower(a, b / 2, m);
return (t * t) % m;
}
else
{
int t = fastpower(a, (b - 1) / 2, m);
t = (t * t) % m;
return a * t % m;
}
}
ll sum(ll n)
{
return (n * (n + 1)) / 2;
}
void BT()
{
int n;
cin >> n;
vi vec(n);
invec(vec, n);
unmapii un;
fwl(i, 0, n)
{
un[vec[i]] = i;
}
int l = un[1];
int r = un[1];
string ans;
ans.push_back('1');
fwl(i, 2, n + 1)
{
l = min(l, un[i]);
r = max(r, un[i]);
if ((r - l + 1) == i)
{
ans.pb('1');
}
else
{
ans.pb('0');
}
}
cout << ans << endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t = 1;
cin >> t;
for (int i = 1; i <= t; i++)
{
BT();
}
return 0;
}
236A - Boy or Girl | 271A - Beautiful Year |
520B - Two Buttons | 231A - Team |
479C - Exams | 1030A - In Search of an Easy Problem |
158A - Next Round | 71A - Way Too Long Words |
160A - Twins | 1A - Theatre Square |
1614B - Divan and a New Project | 791A - Bear and Big Brother |
1452A - Robot Program | 344A - Magnets |
96A - Football | 702B - Powers of Two |
1036A - Function Height | 443A - Anton and Letters |
1478B - Nezzar and Lucky Number | 228A - Is your horseshoe on the other hoof |
122A - Lucky Division | 1611C - Polycarp Recovers the Permutation |
432A - Choosing Teams | 758A - Holiday Of Equality |
1650C - Weight of the System of Nested Segments | 1097A - Gennady and a Card Game |
248A - Cupboards | 1641A - Great Sequence |
1537A - Arithmetic Array | 1370A - Maximum GCD |