#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 6;
const int M = 1e9;
int t, n, x, y;
long long po(long long i, long long j) {
  if (j == 0) return 1;
  return i * po(i, j - 1);
}
bool prime(int x) {
  for (int i = 2; i <= sqrt(x); i++) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}
void solve() {
  scanf("%d", &t);
  while (t--) {
    int m[N / 2];
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) scanf("%d", &x), m[x] = i;
    x = m[1];
    y = m[1];
    for (int i = 1; i <= n; ++i) {
      x = max(x, m[i]);
      y = min(y, m[i]);
      if ((x - y + 1) == i)
        printf("1");
      else
        printf("0");
    }
    printf("\n");
  }
}
int main() { solve(); }
