#include <bits/stdc++.h>
using namespace std;
const double pi =
    3.14159265358979323846264338327950288419716939937510582097494459;
int dX[] = {0, 1, 0, -1, 1, 1, -1, -1};
int dY[] = {1, 0, -1, 0, 1, -1, 1, -1};
string alpha = "abcdefghijklmnopqrstuvwxyz";
const int N = 200100;
int t, par[N], arr[N], siz[N], n, pos[N];
int Find(int u) {
  if (par[u] == u) return u;
  return par[u] = Find(par[u]);
}
void US(int a, int b) {
  a = Find(a);
  b = Find(b);
  if (!a) return;
  if (!b) return;
  par[b] = a;
  siz[a] += siz[b];
}
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i)
      par[i] = i, siz[i] = 1, scanf("%d", &arr[i]), pos[arr[i]] = i;
    arr[n + 1] = 0;
    for (int i = 1; i <= n; ++i) {
      int p = pos[i];
      if (arr[p - 1] < i) US(arr[p - 1], i);
      if (arr[p + 1] < i) US(arr[p + 1], i);
      int first = Find(i);
      int out = (siz[first] == i);
      printf("%d", out);
    }
    puts("");
  }
  return 0;
}
