#include <bits/stdc++.h>
using namespace std;
vector<int> prime;
int a[300050];
vector<pair<int, int> > ks;
int main() {
  int n;
  cin >> n;
  while (n--) {
    ks.clear();
    memset(a, 0, sizeof(a));
    int t, k;
    cin >> t;
    for (int i = 1; i <= t; i++) {
      cin >> k;
      a[k] = i;
    }
    int l, r = l = a[1];
    int s = 2;
    cout << 1;
    for (int i = 2; i <= t; i++) {
      if (a[s] > r) r++;
      if (a[s] < l) l--;
      while (a[s] <= r && a[s] >= l) s++;
      if (i < s)
        cout << 1;
      else
        cout << 0;
    }
    cout << endl;
  }
  return 0;
}
