#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#pragma GCC optimize("unroll-loops")

#include<bits/stdc++.h>
using namespace std;

using ll = long long;
using ld = long double;

using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<double,double>;

using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
using vd = vector<double>;
using vs = vector<string>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;

#define tcT template<class T
#define tcTUU tcT, class ...U
#define tcTU tcT, class U
#define tcTU3 tcTU, class C
#define tcTU4 tcTU3, class D

tcT> using V = vector<T>;
tcT, size_t SZ> using AR = array<T,SZ>;
tcT> using mpq = priority_queue<T, vector<T>, greater<T>>;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

tcT> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define fbo find_by_order
#define ook order_of_key */

#define ut uint64_t
struct fhash {
    static ut s(ut x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
	}
    size_t operator()(ut x) const {
        static const ut r = chrono::steady_clock::now().time_since_epoch().count();
        return s(x+r);
	}
};
#define z(n) static_cast<decay<decltype(n)>::type>(n);
#define cbit(n, b) (((n)>>(b))&1)
#define sbit(n, b) ((n)|(z(1)<<(b)))
#define rbit(n, b) ((n)&~(z(1)<<(b)))
#define fbit(n, b) ((n)^(z(1)<<(b)))

#define ts to_string
#define fe first
#define se second
#define all(x) (x).begin(), (x).end()
#define sz(v) ((int)(v).size())
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

tcTU> T fstTrue(T lo, T hi, U f) {
	while (lo < hi) {
		T mid = (lo+hi)/2;
		f(mid) ? hi = mid : lo = mid+1;
	}
	return lo;
}
tcTU> T lstTrue(T lo, T hi, U f) {
	while (lo < hi) {
		T mid = (lo+hi+1)/2;
		f(mid) ? lo = mid : hi = mid-1;
	}
	return lo;
}

const int di[4]={-1, 0, 1, 0}, dj[4]={0, 1, 0, -1};
const int di8[8]={-1, -1, 0, 1, 1, 1, 0, -1}, dj8[8]={0, 1, 1, 1, 0, -1, -1, -1};
const int MOD = 1e9+7; //const int MOD =998244353;
const ld PI = acos((ld)-1);

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll randint(ll a, ll b) { return uniform_int_distribution<ll>(a, b)(rng);}

bool pow2(int i){ return i&&(i&-i)==i;}
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x))

tcT> bool chmin(T& a, const T& b) {
	return b < a ? a = b, 1 : 0; }
tcT> bool chmax(T& a, const T& b) {
	return a < b ? a = b, 1 : 0; }

tcT> void remDup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)),end(v)); }

// TO_STRING
tcTU3> string ts(tuple<T,U,C> p);
tcTU4> string ts(tuple<T,U,C,D> p);
string ts(char c) { return string(1,c); }
string ts(bool b) {
    #ifdef __APPLE__
		return b ? "true" : "false";
	#else
		return ts((int)b);
	#endif
}
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
tcT> string ts(complex<T> c) {
	stringstream ss; ss << c; return ss.str(); }
string ts(vb v) {
	string res = "{"; F0R(i,sz(v)) res += char('0'+v[i]);
	res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) {
	string res = ""; F0R(i,sz(b)) res += char('0'+b[i]);
	return res; }
tcTU> string ts(pair<T,U> p);
tcT> string ts(T v) { // containers with begin(), end()
	#ifdef __APPLE__
		bool fst = 1; string res = "{";
		for (const auto& x: v) {
			if (!fst) res += ", ";
			fst = 0; res += ts(x);
		}
		res += "}"; return res;
	#else
		bool fst = 1; string res = "";
		for (const auto& x: v) {
			if (!fst) res += " ";
			fst = 0; res += ts(x);
		}
		return res;
	#endif
}
tcTU> string ts(pair<T,U> p) {
	#ifdef __APPLE__
		return "("+ts(p.fe)+", "+ts(p.se)+")";
	#else
		return ts(p.fe)+" "+ts(p.se);
	#endif
}
tcTU3> string ts(tuple<T,U,C> p) {
	#ifdef __APPLE__
	    return "("+ts(get<0>(p))+","+ts(get<1>(p))+","+ts(get<2>(p))+")";
	#else
	    return ts(get<0>(p))+" "+ts(get<1>(p))+" "+ts(get<2>(p));
	#endif
}
tcTU4> string ts(tuple<T,U,C,D> p) {
	#ifdef __APPLE__
	    return "("+ts(get<0>(p))+","+ts(get<1>(p))+","+ts(get<2>(p))+","+ts(get<3>(p))+")";
	#else
	    return ts(get<0>(p))+" "+ts(get<1>(p))+" "+ts(get<2>(p))+" "+ts(get<3>(p));
	#endif
}
//INPUT  void re(string& d){getline(cin,d) ;getline(cin,d); }

tcTU3> void re(tuple<T,U,C>& p);
tcTU4> void re(tuple<T,U,C,D>& p);
tcT> void re(complex<T>& c);
tcTU> void re(pair<T,U>& p);
tcT> void re(vector<T>& v);

tcT, size_t SZ> void re(AR<T,SZ>& a);
tcT> void re(T& x) { cin >> x; }
void re(double& d) { string t; re(t); d = stod(t); }
void re(ld& d) { string t; re(t); d = stold(t); }
tcTUU> void re(T& t, U&... u) { re(t); re(u...); }
tcT> void re(complex<T>& c) { T a,b; re(a,b); c = {a,b}; }
tcTU> void re(pair<T,U>& p) { re(p.f,p.s); }
tcT> void re(vector<T>& x) { trav(a,x) re(a); }
tcT, size_t SZ> void re(array<T,SZ>& x) { trav(a,x) re(a); }
tcTU3> void re(tuple<T,U,C>& p){re(get<0>(p),get<1>(p),get<2>(p));}
tcTU4> void re(tuple<T,U,C,D>& p){re(get<0>(p),get<1>(p),get<2>(p),get<3>(p));}
// OUTPUT
tcT> void pr(T x) { cout << ts(x); }
tcTUU> void pr(const T& t, const U&... u) {
	pr(t); pr(u...); }
void ps() { pr("\n"); } // print w/ spaces
tcTUU> void ps(const T& t, const U&... u) {
	pr(t); if (sizeof...(u)) pr(" "); ps(u...); }

// DEBUG
void DBG() { cerr << "]" << endl; }
tcTUU> void DBG(const T& t, const U&... u) {
	cerr << ts(t); if (sizeof...(u)) cerr << ", ";
	DBG(u...); }
#ifdef __APPLE__ // chk -> fake assert
	#define dbg(...) cerr << "Line(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
	#define chk(...) if (!(__VA_ARGS__)) cerr << "Line(" << __LINE__ << ") -> function(" \
		 << __FUNCTION__  << ") -> CHK FAILED: (" << #__VA_ARGS__ << ")" << "\n", exit(0);
#else
	#define dbg(...) 0
	#define chk(...) 0
#endif

/*
template<int MOD, int RT> struct mint {
	static const int mod = MOD;
	static constexpr mint rt() { return RT; } // primitive root for FFT
	int v; explicit operator int() const { return v; } // explicit -> don't silently convert to int
	mint() { v = 0; }
	mint(ll _v) { v = (-MOD < _v && _v < MOD) ? _v : _v % MOD;
		if (v < 0) v += MOD; }
	friend bool operator==(const mint& a, const mint& b) {
		return a.v == b.v; }
	friend bool operator!=(const mint& a, const mint& b) {
		return !(a == b); }
	friend bool operator<(const mint& a, const mint& b) {
		return a.v < b.v; }
	friend void re(mint& a) { ll x; re(x); a = mint(x); }
	friend string ts(mint a) { return ts(a.v); }

	mint& operator+=(const mint& m) {
		if ((v += m.v) >= MOD) v -= MOD;
		return *this; }
	mint& operator-=(const mint& m) {
		if ((v -= m.v) < 0) v += MOD;
		return *this; }
	mint& operator*=(const mint& m) {
		v = (ll)v*m.v%MOD; return *this; }
	mint& operator/=(const mint& m) { return (*this) *= inv(m); }
	friend mint pow(mint a, ll p) {
		mint ans = 1; assert(p >= 0);
		for (; p; p /= 2, a *= a) if (p&1) ans *= a;
		return ans; }
	friend mint inv(const mint& a) { assert(a.v != 0);
		return pow(a,MOD-2); }

	mint operator-() const { return mint(-v); }
	mint& operator++() { return *this += 1; }
	mint& operator--() { return *this -= 1; }
	friend mint operator+(mint a, const mint& b) { return a += b; }
	friend mint operator-(mint a, const mint& b) { return a -= b; }
	friend mint operator*(mint a, const mint& b) { return a *= b; }
	friend mint operator/(mint a, const mint& b) { return a /= b; }
};

typedef mint<MOD,5> mi; // 5 is primitive root for both common mods
typedef vector<mi> vmi;
typedef pair<mi,mi> pmi;
typedef vector<pmi> vpmi;

vector<vmi> scmb; // small combinations
void genComb(int SZ) {
	scmb.assign(SZ,vmi(SZ)); scmb[0][0] = 1;
	FOR(i,1,SZ) F0R(j,i+1)
		scmb[i][j] = scmb[i-1][j]+(j?scmb[i-1][j-1]:0);
}
ll comb(int a, int b) {
	if (a < b || b < 0) return 0;
	return (ll)fac[a]*ifac[b]%MOD*ifac[a-b]%MOD;
}
*//*
vi invs, fac, ifac;
void genFac(int SZ) { // pre-compute factorial mod inverses
	invs.resize(SZ), fac.resize(SZ), ifac.resize(SZ);
	invs[1] = fac[0] = ifac[0] = 1;
	FOR(i,2,SZ) invs[i] = MOD-(ll)MOD/i*invs[MOD%i]%MOD;
	FOR(i,1,SZ) {
		fac[i] = (ll)fac[i-1]*i%MOD;
		ifac[i] = (ll)ifac[i-1]*invs[i]%MOD;
	}
}
*/

ll gcd(ll a,ll b) {  return b?gcd(b,a%b):a;}
void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }

void IOS(int n=10, string s=""){
  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  cout.precision(n); cerr.precision(n); cerr << fixed; cout << fixed;
  if (sz(s)) { setIn(s+".in"), setOut(s+".out"); }
}

const int mxN = 2e5;

void solve(){
	int n,d=1e9,d1=0,s=0; string ans; re(n); vi a(n),pa(n+1),c; re(a); F0R(i,n) pa[a[i]]=i;
	FOR(i,1,n+1){
		c.pb(pa[i]); chmin(d,pa[i]); chmax(d1,pa[i]);
		s+=pa[i];
		double h1= (d1-d+1),h=h1/2,e=h*(d+d1);
		//sort(all(c)); vi d(sz(c)); iota(all(d),c[0]);
		if((int)e==s) ans+='1';
		else ans+='0';
	}
	ps(ans);
}
int main(){
	IOS();
	int t=1; re(t);
	F0R(i,t){
		//pr("Case #",i+1,": ");
		solve();
	}
#ifdef __APPLE__
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
}


#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#pragma GCC optimize("unroll-loops")

#include<bits/stdc++.h>
using namespace std;

using ll = long long;
using ld = long double;

using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<double,double>;

using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
using vd = vector<double>;
using vs = vector<string>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;

#define tcT template<class T
#define tcTUU tcT, class ...U
#define tcTU tcT, class U
#define tcTU3 tcTU, class C
#define tcTU4 tcTU3, class D

tcT> using V = vector<T>;
tcT, size_t SZ> using AR = array<T,SZ>;
tcT> using mpq = priority_queue<T, vector<T>, greater<T>>;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

tcT> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define fbo find_by_order
#define ook order_of_key */

#define ut uint64_t
struct fhash {
    static ut s(ut x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
	}
    size_t operator()(ut x) const {
        static const ut r = chrono::steady_clock::now().time_since_epoch().count();
        return s(x+r);
	}
};
#define z(n) static_cast<decay<decltype(n)>::type>(n);
#define cbit(n, b) (((n)>>(b))&1)
#define sbit(n, b) ((n)|(z(1)<<(b)))
#define rbit(n, b) ((n)&~(z(1)<<(b)))
#define fbit(n, b) ((n)^(z(1)<<(b)))

#define ts to_string
#define fe first
#define se second
#define all(x) (x).begin(), (x).end()
#define sz(v) ((int)(v).size())
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

tcTU> T fstTrue(T lo, T hi, U f) {
	while (lo < hi) {
		T mid = (lo+hi)/2;
		f(mid) ? hi = mid : lo = mid+1;
	}
	return lo;
}
tcTU> T lstTrue(T lo, T hi, U f) {
	while (lo < hi) {
		T mid = (lo+hi+1)/2;
		f(mid) ? lo = mid : hi = mid-1;
	}
	return lo;
}

const int di[4]={-1, 0, 1, 0}, dj[4]={0, 1, 0, -1};
const int di8[8]={-1, -1, 0, 1, 1, 1, 0, -1}, dj8[8]={0, 1, 1, 1, 0, -1, -1, -1};
const int MOD = 1e9+7; //const int MOD =998244353;
const ld PI = acos((ld)-1);

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll randint(ll a, ll b) { return uniform_int_distribution<ll>(a, b)(rng);}

bool pow2(int i){ return i&&(i&-i)==i;}
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x))

tcT> bool chmin(T& a, const T& b) {
	return b < a ? a = b, 1 : 0; }
tcT> bool chmax(T& a, const T& b) {
	return a < b ? a = b, 1 : 0; }

tcT> void remDup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)),end(v)); }

// TO_STRING
tcTU3> string ts(tuple<T,U,C> p);
tcTU4> string ts(tuple<T,U,C,D> p);
string ts(char c) { return string(1,c); }
string ts(bool b) {
    #ifdef __APPLE__
		return b ? "true" : "false";
	#else
		return ts((int)b);
	#endif
}
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
tcT> string ts(complex<T> c) {
	stringstream ss; ss << c; return ss.str(); }
string ts(vb v) {
	string res = "{"; F0R(i,sz(v)) res += char('0'+v[i]);
	res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) {
	string res = ""; F0R(i,sz(b)) res += char('0'+b[i]);
	return res; }
tcTU> string ts(pair<T,U> p);
tcT> string ts(T v) { // containers with begin(), end()
	#ifdef __APPLE__
		bool fst = 1; string res = "{";
		for (const auto& x: v) {
			if (!fst) res += ", ";
			fst = 0; res += ts(x);
		}
		res += "}"; return res;
	#else
		bool fst = 1; string res = "";
		for (const auto& x: v) {
			if (!fst) res += " ";
			fst = 0; res += ts(x);
		}
		return res;
	#endif
}
tcTU> string ts(pair<T,U> p) {
	#ifdef __APPLE__
		return "("+ts(p.fe)+", "+ts(p.se)+")";
	#else
		return ts(p.fe)+" "+ts(p.se);
	#endif
}
tcTU3> string ts(tuple<T,U,C> p) {
	#ifdef __APPLE__
	    return "("+ts(get<0>(p))+","+ts(get<1>(p))+","+ts(get<2>(p))+")";
	#else
	    return ts(get<0>(p))+" "+ts(get<1>(p))+" "+ts(get<2>(p));
	#endif
}
tcTU4> string ts(tuple<T,U,C,D> p) {
	#ifdef __APPLE__
	    return "("+ts(get<0>(p))+","+ts(get<1>(p))+","+ts(get<2>(p))+","+ts(get<3>(p))+")";
	#else
	    return ts(get<0>(p))+" "+ts(get<1>(p))+" "+ts(get<2>(p))+" "+ts(get<3>(p));
	#endif
}
//INPUT  void re(string& d){getline(cin,d) ;getline(cin,d); }

tcTU3> void re(tuple<T,U,C>& p);
tcTU4> void re(tuple<T,U,C,D>& p);
tcT> void re(complex<T>& c);
tcTU> void re(pair<T,U>& p);
tcT> void re(vector<T>& v);

tcT, size_t SZ> void re(AR<T,SZ>& a);
tcT> void re(T& x) { cin >> x; }
void re(double& d) { string t; re(t); d = stod(t); }
void re(ld& d) { string t; re(t); d = stold(t); }
tcTUU> void re(T& t, U&... u) { re(t); re(u...); }
tcT> void re(complex<T>& c) { T a,b; re(a,b); c = {a,b}; }
tcTU> void re(pair<T,U>& p) { re(p.f,p.s); }
tcT> void re(vector<T>& x) { trav(a,x) re(a); }
tcT, size_t SZ> void re(array<T,SZ>& x) { trav(a,x) re(a); }
tcTU3> void re(tuple<T,U,C>& p){re(get<0>(p),get<1>(p),get<2>(p));}
tcTU4> void re(tuple<T,U,C,D>& p){re(get<0>(p),get<1>(p),get<2>(p),get<3>(p));}
// OUTPUT
tcT> void pr(T x) { cout << ts(x); }
tcTUU> void pr(const T& t, const U&... u) {
	pr(t); pr(u...); }
void ps() { pr("\n"); } // print w/ spaces
tcTUU> void ps(const T& t, const U&... u) {
	pr(t); if (sizeof...(u)) pr(" "); ps(u...); }

// DEBUG
void DBG() { cerr << "]" << endl; }
tcTUU> void DBG(const T& t, const U&... u) {
	cerr << ts(t); if (sizeof...(u)) cerr << ", ";
	DBG(u...); }
#ifdef __APPLE__ // chk -> fake assert
	#define dbg(...) cerr << "Line(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
	#define chk(...) if (!(__VA_ARGS__)) cerr << "Line(" << __LINE__ << ") -> function(" \
		 << __FUNCTION__  << ") -> CHK FAILED: (" << #__VA_ARGS__ << ")" << "\n", exit(0);
#else
	#define dbg(...) 0
	#define chk(...) 0
#endif

/*
template<int MOD, int RT> struct mint {
	static const int mod = MOD;
	static constexpr mint rt() { return RT; } // primitive root for FFT
	int v; explicit operator int() const { return v; } // explicit -> don't silently convert to int
	mint() { v = 0; }
	mint(ll _v) { v = (-MOD < _v && _v < MOD) ? _v : _v % MOD;
		if (v < 0) v += MOD; }
	friend bool operator==(const mint& a, const mint& b) {
		return a.v == b.v; }
	friend bool operator!=(const mint& a, const mint& b) {
		return !(a == b); }
	friend bool operator<(const mint& a, const mint& b) {
		return a.v < b.v; }
	friend void re(mint& a) { ll x; re(x); a = mint(x); }
	friend string ts(mint a) { return ts(a.v); }

	mint& operator+=(const mint& m) {
		if ((v += m.v) >= MOD) v -= MOD;
		return *this; }
	mint& operator-=(const mint& m) {
		if ((v -= m.v) < 0) v += MOD;
		return *this; }
	mint& operator*=(const mint& m) {
		v = (ll)v*m.v%MOD; return *this; }
	mint& operator/=(const mint& m) { return (*this) *= inv(m); }
	friend mint pow(mint a, ll p) {
		mint ans = 1; assert(p >= 0);
		for (; p; p /= 2, a *= a) if (p&1) ans *= a;
		return ans; }
	friend mint inv(const mint& a) { assert(a.v != 0);
		return pow(a,MOD-2); }

	mint operator-() const { return mint(-v); }
	mint& operator++() { return *this += 1; }
	mint& operator--() { return *this -= 1; }
	friend mint operator+(mint a, const mint& b) { return a += b; }
	friend mint operator-(mint a, const mint& b) { return a -= b; }
	friend mint operator*(mint a, const mint& b) { return a *= b; }
	friend mint operator/(mint a, const mint& b) { return a /= b; }
};

typedef mint<MOD,5> mi; // 5 is primitive root for both common mods
typedef vector<mi> vmi;
typedef pair<mi,mi> pmi;
typedef vector<pmi> vpmi;

vector<vmi> scmb; // small combinations
void genComb(int SZ) {
	scmb.assign(SZ,vmi(SZ)); scmb[0][0] = 1;
	FOR(i,1,SZ) F0R(j,i+1)
		scmb[i][j] = scmb[i-1][j]+(j?scmb[i-1][j-1]:0);
}
ll comb(int a, int b) {
	if (a < b || b < 0) return 0;
	return (ll)fac[a]*ifac[b]%MOD*ifac[a-b]%MOD;
}
*//*
vi invs, fac, ifac;
void genFac(int SZ) { // pre-compute factorial mod inverses
	invs.resize(SZ), fac.resize(SZ), ifac.resize(SZ);
	invs[1] = fac[0] = ifac[0] = 1;
	FOR(i,2,SZ) invs[i] = MOD-(ll)MOD/i*invs[MOD%i]%MOD;
	FOR(i,1,SZ) {
		fac[i] = (ll)fac[i-1]*i%MOD;
		ifac[i] = (ll)ifac[i-1]*invs[i]%MOD;
	}
}
*/

ll gcd(ll a,ll b) {  return b?gcd(b,a%b):a;}
void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }

void IOS(int n=10, string s=""){
  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  cout.precision(n); cerr.precision(n); cerr << fixed; cout << fixed;
  if (sz(s)) { setIn(s+".in"), setOut(s+".out"); }
}

const int mxN = 2e5;

void solve(){
	ll n,d=1e9,d1=0,s=0; string ans; re(n); vl a(n),pa(n+1),c; re(a); F0R(i,n) pa[a[i]]=i;
	FOR(i,1,n+1){
		c.pb(pa[i]); chmin(d,pa[i]); chmax(d1,pa[i]);
		s+=pa[i];
		ld h1= (d1-d+1),h=h1/2,e=h*(d+d1);
		//sort(all(c)); vi d(sz(c)); iota(all(d),c[0]);
		if((ll)e==s) ans+='1';
		else ans+='0';
	}
	ps(ans);
}
int main(){
	IOS();
	int t=1; re(t);
	F0R(i,t){
		//pr("Case #",i+1,": ");
		solve();
	}
#ifdef __APPLE__
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
}


#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#pragma GCC optimize("unroll-loops")

#include<bits/stdc++.h>
using namespace std;

using ll = long long;
using ld = long double;

using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<double,double>;

using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
using vd = vector<double>;
using vs = vector<string>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;

#define tcT template<class T
#define tcTUU tcT, class ...U
#define tcTU tcT, class U
#define tcTU3 tcTU, class C
#define tcTU4 tcTU3, class D

tcT> using V = vector<T>;
tcT, size_t SZ> using AR = array<T,SZ>;
tcT> using mpq = priority_queue<T, vector<T>, greater<T>>;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

tcT> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define fbo find_by_order
#define ook order_of_key */

#define ut uint64_t
struct fhash {
    static ut s(ut x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
	}
    size_t operator()(ut x) const {
        static const ut r = chrono::steady_clock::now().time_since_epoch().count();
        return s(x+r);
	}
};
#define z(n) static_cast<decay<decltype(n)>::type>(n);
#define cbit(n, b) (((n)>>(b))&1)
#define sbit(n, b) ((n)|(z(1)<<(b)))
#define rbit(n, b) ((n)&~(z(1)<<(b)))
#define fbit(n, b) ((n)^(z(1)<<(b)))

#define ts to_string
#define fe first
#define se second
#define all(x) (x).begin(), (x).end()
#define sz(v) ((int)(v).size())
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

tcTU> T fstTrue(T lo, T hi, U f) {
	while (lo < hi) {
		T mid = (lo+hi)/2;
		f(mid) ? hi = mid : lo = mid+1;
	}
	return lo;
}
tcTU> T lstTrue(T lo, T hi, U f) {
	while (lo < hi) {
		T mid = (lo+hi+1)/2;
		f(mid) ? lo = mid : hi = mid-1;
	}
	return lo;
}

const int di[4]={-1, 0, 1, 0}, dj[4]={0, 1, 0, -1};
const int di8[8]={-1, -1, 0, 1, 1, 1, 0, -1}, dj8[8]={0, 1, 1, 1, 0, -1, -1, -1};
const int MOD = 1e9+7; //const int MOD =998244353;
const ld PI = acos((ld)-1);

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll randint(ll a, ll b) { return uniform_int_distribution<ll>(a, b)(rng);}

bool pow2(int i){ return i&&(i&-i)==i;}
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x))

tcT> bool chmin(T& a, const T& b) {
	return b < a ? a = b, 1 : 0; }
tcT> bool chmax(T& a, const T& b) {
	return a < b ? a = b, 1 : 0; }

tcT> void remDup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)),end(v)); }

// TO_STRING
tcTU3> string ts(tuple<T,U,C> p);
tcTU4> string ts(tuple<T,U,C,D> p);
string ts(char c) { return string(1,c); }
string ts(bool b) {
    #ifdef __APPLE__
		return b ? "true" : "false";
	#else
		return ts((int)b);
	#endif
}
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
tcT> string ts(complex<T> c) {
	stringstream ss; ss << c; return ss.str(); }
string ts(vb v) {
	string res = "{"; F0R(i,sz(v)) res += char('0'+v[i]);
	res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) {
	string res = ""; F0R(i,sz(b)) res += char('0'+b[i]);
	return res; }
tcTU> string ts(pair<T,U> p);
tcT> string ts(T v) { // containers with begin(), end()
	#ifdef __APPLE__
		bool fst = 1; string res = "{";
		for (const auto& x: v) {
			if (!fst) res += ", ";
			fst = 0; res += ts(x);
		}
		res += "}"; return res;
	#else
		bool fst = 1; string res = "";
		for (const auto& x: v) {
			if (!fst) res += " ";
			fst = 0; res += ts(x);
		}
		return res;
	#endif
}
tcTU> string ts(pair<T,U> p) {
	#ifdef __APPLE__
		return "("+ts(p.fe)+", "+ts(p.se)+")";
	#else
		return ts(p.fe)+" "+ts(p.se);
	#endif
}
tcTU3> string ts(tuple<T,U,C> p) {
	#ifdef __APPLE__
	    return "("+ts(get<0>(p))+","+ts(get<1>(p))+","+ts(get<2>(p))+")";
	#else
	    return ts(get<0>(p))+" "+ts(get<1>(p))+" "+ts(get<2>(p));
	#endif
}
tcTU4> string ts(tuple<T,U,C,D> p) {
	#ifdef __APPLE__
	    return "("+ts(get<0>(p))+","+ts(get<1>(p))+","+ts(get<2>(p))+","+ts(get<3>(p))+")";
	#else
	    return ts(get<0>(p))+" "+ts(get<1>(p))+" "+ts(get<2>(p))+" "+ts(get<3>(p));
	#endif
}
//INPUT  void re(string& d){getline(cin,d) ;getline(cin,d); }

tcTU3> void re(tuple<T,U,C>& p);
tcTU4> void re(tuple<T,U,C,D>& p);
tcT> void re(complex<T>& c);
tcTU> void re(pair<T,U>& p);
tcT> void re(vector<T>& v);

tcT, size_t SZ> void re(AR<T,SZ>& a);
tcT> void re(T& x) { cin >> x; }
void re(double& d) { string t; re(t); d = stod(t); }
void re(ld& d) { string t; re(t); d = stold(t); }
tcTUU> void re(T& t, U&... u) { re(t); re(u...); }
tcT> void re(complex<T>& c) { T a,b; re(a,b); c = {a,b}; }
tcTU> void re(pair<T,U>& p) { re(p.f,p.s); }
tcT> void re(vector<T>& x) { trav(a,x) re(a); }
tcT, size_t SZ> void re(array<T,SZ>& x) { trav(a,x) re(a); }
tcTU3> void re(tuple<T,U,C>& p){re(get<0>(p),get<1>(p),get<2>(p));}
tcTU4> void re(tuple<T,U,C,D>& p){re(get<0>(p),get<1>(p),get<2>(p),get<3>(p));}
// OUTPUT
tcT> void pr(T x) { cout << ts(x); }
tcTUU> void pr(const T& t, const U&... u) {
	pr(t); pr(u...); }
void ps() { pr("\n"); } // print w/ spaces
tcTUU> void ps(const T& t, const U&... u) {
	pr(t); if (sizeof...(u)) pr(" "); ps(u...); }

// DEBUG
void DBG() { cerr << "]" << endl; }
tcTUU> void DBG(const T& t, const U&... u) {
	cerr << ts(t); if (sizeof...(u)) cerr << ", ";
	DBG(u...); }
#ifdef __APPLE__ // chk -> fake assert
	#define dbg(...) cerr << "Line(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
	#define chk(...) if (!(__VA_ARGS__)) cerr << "Line(" << __LINE__ << ") -> function(" \
		 << __FUNCTION__  << ") -> CHK FAILED: (" << #__VA_ARGS__ << ")" << "\n", exit(0);
#else
	#define dbg(...) 0
	#define chk(...) 0
#endif

/*
template<int MOD, int RT> struct mint {
	static const int mod = MOD;
	static constexpr mint rt() { return RT; } // primitive root for FFT
	int v; explicit operator int() const { return v; } // explicit -> don't silently convert to int
	mint() { v = 0; }
	mint(ll _v) { v = (-MOD < _v && _v < MOD) ? _v : _v % MOD;
		if (v < 0) v += MOD; }
	friend bool operator==(const mint& a, const mint& b) {
		return a.v == b.v; }
	friend bool operator!=(const mint& a, const mint& b) {
		return !(a == b); }
	friend bool operator<(const mint& a, const mint& b) {
		return a.v < b.v; }
	friend void re(mint& a) { ll x; re(x); a = mint(x); }
	friend string ts(mint a) { return ts(a.v); }

	mint& operator+=(const mint& m) {
		if ((v += m.v) >= MOD) v -= MOD;
		return *this; }
	mint& operator-=(const mint& m) {
		if ((v -= m.v) < 0) v += MOD;
		return *this; }
	mint& operator*=(const mint& m) {
		v = (ll)v*m.v%MOD; return *this; }
	mint& operator/=(const mint& m) { return (*this) *= inv(m); }
	friend mint pow(mint a, ll p) {
		mint ans = 1; assert(p >= 0);
		for (; p; p /= 2, a *= a) if (p&1) ans *= a;
		return ans; }
	friend mint inv(const mint& a) { assert(a.v != 0);
		return pow(a,MOD-2); }

	mint operator-() const { return mint(-v); }
	mint& operator++() { return *this += 1; }
	mint& operator--() { return *this -= 1; }
	friend mint operator+(mint a, const mint& b) { return a += b; }
	friend mint operator-(mint a, const mint& b) { return a -= b; }
	friend mint operator*(mint a, const mint& b) { return a *= b; }
	friend mint operator/(mint a, const mint& b) { return a /= b; }
};

typedef mint<MOD,5> mi; // 5 is primitive root for both common mods
typedef vector<mi> vmi;
typedef pair<mi,mi> pmi;
typedef vector<pmi> vpmi;

vector<vmi> scmb; // small combinations
void genComb(int SZ) {
	scmb.assign(SZ,vmi(SZ)); scmb[0][0] = 1;
	FOR(i,1,SZ) F0R(j,i+1)
		scmb[i][j] = scmb[i-1][j]+(j?scmb[i-1][j-1]:0);
}
ll comb(int a, int b) {
	if (a < b || b < 0) return 0;
	return (ll)fac[a]*ifac[b]%MOD*ifac[a-b]%MOD;
}
*//*
vi invs, fac, ifac;
void genFac(int SZ) { // pre-compute factorial mod inverses
	invs.resize(SZ), fac.resize(SZ), ifac.resize(SZ);
	invs[1] = fac[0] = ifac[0] = 1;
	FOR(i,2,SZ) invs[i] = MOD-(ll)MOD/i*invs[MOD%i]%MOD;
	FOR(i,1,SZ) {
		fac[i] = (ll)fac[i-1]*i%MOD;
		ifac[i] = (ll)ifac[i-1]*invs[i]%MOD;
	}
}
*/

ll gcd(ll a,ll b) {  return b?gcd(b,a%b):a;}
void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }

void IOS(int n=10, string s=""){
  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  cout.precision(n); cerr.precision(n); cerr << fixed; cout << fixed;
  if (sz(s)) { setIn(s+".in"), setOut(s+".out"); }
}

const int mxN = 2e5;

void solve(){
	int n; string ans; re(n); vi a(n),pa(n+1),c; re(a); F0R(i,n) pa[a[i]]=i;
	FOR(i,1,n+1){
		c.pb(pa[i]); sort(all(c)); vi d(sz(c)); iota(all(d),c[0]);
		if(c==d) ans+='1';
		else ans+='0';
	}
	ps(ans);
}
int main(){
	IOS();
	int t=1; re(t);
	F0R(i,t){
		//pr("Case #",i+1,": ");
		solve();
	}
#ifdef __APPLE__
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
}


#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#pragma GCC optimize("unroll-loops")

#include<bits/stdc++.h>
using namespace std;

using ll = long long;
using ld = long double;

using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<double,double>;

using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
using vd = vector<double>;
using vs = vector<string>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;

#define tcT template<class T
#define tcTUU tcT, class ...U
#define tcTU tcT, class U
#define tcTU3 tcTU, class C
#define tcTU4 tcTU3, class D

tcT> using V = vector<T>;
tcT, size_t SZ> using AR = array<T,SZ>;
tcT> using mpq = priority_queue<T, vector<T>, greater<T>>;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

tcT> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define fbo find_by_order
#define ook order_of_key */

#define ut uint64_t
struct fhash {
    static ut s(ut x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
	}
    size_t operator()(ut x) const {
        static const ut r = chrono::steady_clock::now().time_since_epoch().count();
        return s(x+r);
	}
};
#define z(n) static_cast<decay<decltype(n)>::type>(n);
#define cbit(n, b) (((n)>>(b))&1)
#define sbit(n, b) ((n)|(z(1)<<(b)))
#define rbit(n, b) ((n)&~(z(1)<<(b)))
#define fbit(n, b) ((n)^(z(1)<<(b)))

#define ts to_string
#define fe first
#define se second
#define all(x) (x).begin(), (x).end()
#define sz(v) ((int)(v).size())
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

tcTU> T fstTrue(T lo, T hi, U f) {
	while (lo < hi) {
		T mid = (lo+hi)/2;
		f(mid) ? hi = mid : lo = mid+1;
	}
	return lo;
}
tcTU> T lstTrue(T lo, T hi, U f) {
	while (lo < hi) {
		T mid = (lo+hi+1)/2;
		f(mid) ? lo = mid : hi = mid-1;
	}
	return lo;
}

const int di[4]={-1, 0, 1, 0}, dj[4]={0, 1, 0, -1};
const int di8[8]={-1, -1, 0, 1, 1, 1, 0, -1}, dj8[8]={0, 1, 1, 1, 0, -1, -1, -1};
const int MOD = 1e9+7; //const int MOD =998244353;
const ld PI = acos((ld)-1);

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll randint(ll a, ll b) { return uniform_int_distribution<ll>(a, b)(rng);}

bool pow2(int i){ return i&&(i&-i)==i;}
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x))

tcT> bool chmin(T& a, const T& b) {
	return b < a ? a = b, 1 : 0; }
tcT> bool chmax(T& a, const T& b) {
	return a < b ? a = b, 1 : 0; }

tcT> void remDup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)),end(v)); }

// TO_STRING
tcTU3> string ts(tuple<T,U,C> p);
tcTU4> string ts(tuple<T,U,C,D> p);
string ts(char c) { return string(1,c); }
string ts(bool b) {
    #ifdef __APPLE__
		return b ? "true" : "false";
	#else
		return ts((int)b);
	#endif
}
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
tcT> string ts(complex<T> c) {
	stringstream ss; ss << c; return ss.str(); }
string ts(vb v) {
	string res = "{"; F0R(i,sz(v)) res += char('0'+v[i]);
	res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) {
	string res = ""; F0R(i,sz(b)) res += char('0'+b[i]);
	return res; }
tcTU> string ts(pair<T,U> p);
tcT> string ts(T v) { // containers with begin(), end()
	#ifdef __APPLE__
		bool fst = 1; string res = "{";
		for (const auto& x: v) {
			if (!fst) res += ", ";
			fst = 0; res += ts(x);
		}
		res += "}"; return res;
	#else
		bool fst = 1; string res = "";
		for (const auto& x: v) {
			if (!fst) res += " ";
			fst = 0; res += ts(x);
		}
		return res;
	#endif
}
tcTU> string ts(pair<T,U> p) {
	#ifdef __APPLE__
		return "("+ts(p.fe)+", "+ts(p.se)+")";
	#else
		return ts(p.fe)+" "+ts(p.se);
	#endif
}
tcTU3> string ts(tuple<T,U,C> p) {
	#ifdef __APPLE__
	    return "("+ts(get<0>(p))+","+ts(get<1>(p))+","+ts(get<2>(p))+")";
	#else
	    return ts(get<0>(p))+" "+ts(get<1>(p))+" "+ts(get<2>(p));
	#endif
}
tcTU4> string ts(tuple<T,U,C,D> p) {
	#ifdef __APPLE__
	    return "("+ts(get<0>(p))+","+ts(get<1>(p))+","+ts(get<2>(p))+","+ts(get<3>(p))+")";
	#else
	    return ts(get<0>(p))+" "+ts(get<1>(p))+" "+ts(get<2>(p))+" "+ts(get<3>(p));
	#endif
}
//INPUT  void re(string& d){getline(cin,d) ;getline(cin,d); }

tcTU3> void re(tuple<T,U,C>& p);
tcTU4> void re(tuple<T,U,C,D>& p);
tcT> void re(complex<T>& c);
tcTU> void re(pair<T,U>& p);
tcT> void re(vector<T>& v);

tcT, size_t SZ> void re(AR<T,SZ>& a);
tcT> void re(T& x) { cin >> x; }
void re(double& d) { string t; re(t); d = stod(t); }
void re(ld& d) { string t; re(t); d = stold(t); }
tcTUU> void re(T& t, U&... u) { re(t); re(u...); }
tcT> void re(complex<T>& c) { T a,b; re(a,b); c = {a,b}; }
tcTU> void re(pair<T,U>& p) { re(p.f,p.s); }
tcT> void re(vector<T>& x) { trav(a,x) re(a); }
tcT, size_t SZ> void re(array<T,SZ>& x) { trav(a,x) re(a); }
tcTU3> void re(tuple<T,U,C>& p){re(get<0>(p),get<1>(p),get<2>(p));}
tcTU4> void re(tuple<T,U,C,D>& p){re(get<0>(p),get<1>(p),get<2>(p),get<3>(p));}
// OUTPUT
tcT> void pr(T x) { cout << ts(x); }
tcTUU> void pr(const T& t, const U&... u) {
	pr(t); pr(u...); }
void ps() { pr("\n"); } // print w/ spaces
tcTUU> void ps(const T& t, const U&... u) {
	pr(t); if (sizeof...(u)) pr(" "); ps(u...); }

// DEBUG
void DBG() { cerr << "]" << endl; }
tcTUU> void DBG(const T& t, const U&... u) {
	cerr << ts(t); if (sizeof...(u)) cerr << ", ";
	DBG(u...); }
#ifdef __APPLE__ // chk -> fake assert
	#define dbg(...) cerr << "Line(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
	#define chk(...) if (!(__VA_ARGS__)) cerr << "Line(" << __LINE__ << ") -> function(" \
		 << __FUNCTION__  << ") -> CHK FAILED: (" << #__VA_ARGS__ << ")" << "\n", exit(0);
#else
	#define dbg(...) 0
	#define chk(...) 0
#endif

/*
template<int MOD, int RT> struct mint {
	static const int mod = MOD;
	static constexpr mint rt() { return RT; } // primitive root for FFT
	int v; explicit operator int() const { return v; } // explicit -> don't silently convert to int
	mint() { v = 0; }
	mint(ll _v) { v = (-MOD < _v && _v < MOD) ? _v : _v % MOD;
		if (v < 0) v += MOD; }
	friend bool operator==(const mint& a, const mint& b) {
		return a.v == b.v; }
	friend bool operator!=(const mint& a, const mint& b) {
		return !(a == b); }
	friend bool operator<(const mint& a, const mint& b) {
		return a.v < b.v; }
	friend void re(mint& a) { ll x; re(x); a = mint(x); }
	friend string ts(mint a) { return ts(a.v); }

	mint& operator+=(const mint& m) {
		if ((v += m.v) >= MOD) v -= MOD;
		return *this; }
	mint& operator-=(const mint& m) {
		if ((v -= m.v) < 0) v += MOD;
		return *this; }
	mint& operator*=(const mint& m) {
		v = (ll)v*m.v%MOD; return *this; }
	mint& operator/=(const mint& m) { return (*this) *= inv(m); }
	friend mint pow(mint a, ll p) {
		mint ans = 1; assert(p >= 0);
		for (; p; p /= 2, a *= a) if (p&1) ans *= a;
		return ans; }
	friend mint inv(const mint& a) { assert(a.v != 0);
		return pow(a,MOD-2); }

	mint operator-() const { return mint(-v); }
	mint& operator++() { return *this += 1; }
	mint& operator--() { return *this -= 1; }
	friend mint operator+(mint a, const mint& b) { return a += b; }
	friend mint operator-(mint a, const mint& b) { return a -= b; }
	friend mint operator*(mint a, const mint& b) { return a *= b; }
	friend mint operator/(mint a, const mint& b) { return a /= b; }
};

typedef mint<MOD,5> mi; // 5 is primitive root for both common mods
typedef vector<mi> vmi;
typedef pair<mi,mi> pmi;
typedef vector<pmi> vpmi;

vector<vmi> scmb; // small combinations
void genComb(int SZ) {
	scmb.assign(SZ,vmi(SZ)); scmb[0][0] = 1;
	FOR(i,1,SZ) F0R(j,i+1)
		scmb[i][j] = scmb[i-1][j]+(j?scmb[i-1][j-1]:0);
}
ll comb(int a, int b) {
	if (a < b || b < 0) return 0;
	return (ll)fac[a]*ifac[b]%MOD*ifac[a-b]%MOD;
}
*//*
vi invs, fac, ifac;
void genFac(int SZ) { // pre-compute factorial mod inverses
	invs.resize(SZ), fac.resize(SZ), ifac.resize(SZ);
	invs[1] = fac[0] = ifac[0] = 1;
	FOR(i,2,SZ) invs[i] = MOD-(ll)MOD/i*invs[MOD%i]%MOD;
	FOR(i,1,SZ) {
		fac[i] = (ll)fac[i-1]*i%MOD;
		ifac[i] = (ll)ifac[i-1]*invs[i]%MOD;
	}
}
*/

ll gcd(ll a,ll b) {  return b?gcd(b,a%b):a;}
void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }

void IOS(int n=10, string s=""){
  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  cout.precision(n); cerr.precision(n); cerr << fixed; cout << fixed;
  if (sz(s)) { setIn(s+".in"), setOut(s+".out"); }
}

const int mxN = 2e5;

void solve(){
	ll n,d=1e9,d1=0,s=0; string ans; re(n); vi a(n),pa(n+1),c; re(a); F0R(i,n) pa[a[i]]=i;
	FOR(i,1,n+1){
		c.pb(pa[i]); chmin(d,pa[i]); chmax(d1,pa[i]);
		s+=pa[i];
		double h1= (d1-d+1),h=h1/2,e=h*(d+d1);
		//sort(all(c)); vi d(sz(c)); iota(all(d),c[0]);
		if((int)e==s) ans+='1';
		else ans+='0';
	}
	ps(ans);
}
int main(){
	IOS();
	int t=1; re(t);
	F0R(i,t){
		//pr("Case #",i+1,": ");
		solve();
	}
#ifdef __APPLE__
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
}


#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#pragma GCC optimize("unroll-loops")

#include<bits/stdc++.h>
using namespace std;

#define int long long
using ld = long double;
using pi = pair<int,int>;
using pd = pair<double,double>;

using vi = vector<int>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;
using vpi = vector<pi>;
using vpd = vector<pd>;

#define tcT template<class T
#define tcTUU tcT, class ...U
#define tcTU tcT, class U
#define tcTU3 tcTU, class C
#define tcTU4 tcTU3, class D

tcT> using V = vector<T>;
tcT, size_t SZ> using AR = array<T,SZ>;
tcT> using mpq = priority_queue<T, vector<T>, greater<T>>;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

tcT> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define fbo find_by_order
#define ook order_of_key */

#define ut uint64_t
struct fhash {
    static ut s(ut x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
	}
    size_t operator()(ut x) const {
        static const ut r = chrono::steady_clock::now().time_since_epoch().count();
        return s(x+r);
	}
};
#define z(n) static_cast<decay<decltype(n)>::type>(n);
#define cbit(n, b) (((n)>>(b))&1)
#define sbit(n, b) ((n)|(z(1)<<(b)))
#define rbit(n, b) ((n)&~(z(1)<<(b)))
#define fbit(n, b) ((n)^(z(1)<<(b)))

#define ts to_string
#define fe first
#define se second
#define all(x) (x).begin(), (x).end()
#define sz(v) ((int)(v).size())
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

tcTU> T fstTrue(T lo, T hi, U f) {
	while (lo < hi) {
		T mid = (lo+hi)/2;
		f(mid) ? hi = mid : lo = mid+1;
	}
	return lo;
}
tcTU> T lstTrue(T lo, T hi, U f) {
	while (lo < hi) {
		T mid = (lo+hi+1)/2;
		f(mid) ? lo = mid : hi = mid-1;
	}
	return lo;
}

const int di[4]={-1, 0, 1, 0}, dj[4]={0, 1, 0, -1};
const int di8[8]={-1, -1, 0, 1, 1, 1, 0, -1}, dj8[8]={0, 1, 1, 1, 0, -1, -1, -1};
const int MOD = 1e9+7; //const int MOD =998244353;
const ld PI = acos((ld)-1);

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int randint(int a, int b) { return uniform_int_distribution<int>(a, b)(rng);}

bool pow2(int i){ return i&&(i&-i)==i;}
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x))

tcT> bool chmin(T& a, const T& b) {
	return b < a ? a = b, 1 : 0; }
tcT> bool chmax(T& a, const T& b) {
	return a < b ? a = b, 1 : 0; }

tcT> void remDup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)),end(v)); }

// TO_STRING
tcTU3> string ts(tuple<T,U,C> p);
tcTU4> string ts(tuple<T,U,C,D> p);
string ts(char c) { return string(1,c); }
string ts(bool b) {
    #ifdef __APPLE__
		return b ? "true" : "false";
	#else
		return ts((int)b);
	#endif
}
string ts(const char* s) { return (string)s; }
string ts(string s) { return s; }
tcT> string ts(complex<T> c) {
	stringstream ss; ss << c; return ss.str(); }
string ts(vb v) {
	string res = "{"; F0R(i,sz(v)) res += char('0'+v[i]);
	res += "}"; return res; }
template<size_t SZ> string ts(bitset<SZ> b) {
	string res = ""; F0R(i,sz(b)) res += char('0'+b[i]);
	return res; }
tcTU> string ts(pair<T,U> p);
tcT> string ts(T v) { // containers with begin(), end()
	#ifdef __APPLE__
		bool fst = 1; string res = "{";
		for (const auto& x: v) {
			if (!fst) res += ", ";
			fst = 0; res += ts(x);
		}
		res += "}"; return res;
	#else
		bool fst = 1; string res = "";
		for (const auto& x: v) {
			if (!fst) res += " ";
			fst = 0; res += ts(x);
		}
		return res;
	#endif
}
tcTU> string ts(pair<T,U> p) {
	#ifdef __APPLE__
		return "("+ts(p.fe)+", "+ts(p.se)+")";
	#else
		return ts(p.fe)+" "+ts(p.se);
	#endif
}
tcTU3> string ts(tuple<T,U,C> p) {
	#ifdef __APPLE__
	    return "("+ts(get<0>(p))+","+ts(get<1>(p))+","+ts(get<2>(p))+")";
	#else
	    return ts(get<0>(p))+" "+ts(get<1>(p))+" "+ts(get<2>(p));
	#endif
}
tcTU4> string ts(tuple<T,U,C,D> p) {
	#ifdef __APPLE__
	    return "("+ts(get<0>(p))+","+ts(get<1>(p))+","+ts(get<2>(p))+","+ts(get<3>(p))+")";
	#else
	    return ts(get<0>(p))+" "+ts(get<1>(p))+" "+ts(get<2>(p))+" "+ts(get<3>(p));
	#endif
}
//INPUT  void re(string& d){getline(cin,d) ;getline(cin,d); }

tcTU3> void re(tuple<T,U,C>& p);
tcTU4> void re(tuple<T,U,C,D>& p);
tcT> void re(complex<T>& c);
tcTU> void re(pair<T,U>& p);
tcT> void re(vector<T>& v);

tcT, size_t SZ> void re(AR<T,SZ>& a);
tcT> void re(T& x) { cin >> x; }
void re(double& d) { string t; re(t); d = stod(t); }
void re(ld& d) { string t; re(t); d = stold(t); }
tcTUU> void re(T& t, U&... u) { re(t); re(u...); }
tcT> void re(complex<T>& c) { T a,b; re(a,b); c = {a,b}; }
tcTU> void re(pair<T,U>& p) { re(p.f,p.s); }
tcT> void re(vector<T>& x) { trav(a,x) re(a); }
tcT, size_t SZ> void re(array<T,SZ>& x) { trav(a,x) re(a); }
tcTU3> void re(tuple<T,U,C>& p){re(get<0>(p),get<1>(p),get<2>(p));}
tcTU4> void re(tuple<T,U,C,D>& p){re(get<0>(p),get<1>(p),get<2>(p),get<3>(p));}
// OUTPUT
tcT> void pr(T x) { cout << ts(x); }
tcTUU> void pr(const T& t, const U&... u) {
	pr(t); pr(u...); }
void ps() { pr("\n"); } // print w/ spaces
tcTUU> void ps(const T& t, const U&... u) {
	pr(t); if (sizeof...(u)) pr(" "); ps(u...); }

// DEBUG
void DBG() { cerr << "]" << endl; }
tcTUU> void DBG(const T& t, const U&... u) {
	cerr << ts(t); if (sizeof...(u)) cerr << ", ";
	DBG(u...); }
#ifdef __APPLE__ // chk -> fake assert
	#define dbg(...) cerr << "Line(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
	#define chk(...) if (!(__VA_ARGS__)) cerr << "Line(" << __LINE__ << ") -> function(" \
		 << __FUNCTION__  << ") -> CHK FAILED: (" << #__VA_ARGS__ << ")" << "\n", exit(0);
#else
	#define dbg(...) 0
	#define chk(...) 0
#endif

/*
template<int MOD, int RT> struct mint {
	static const int mod = MOD;
	static constexpr mint rt() { return RT; } // primitive root for FFT
	int v; explicit operator int() const { return v; } // explicit -> don't silently convert to int
	mint() { v = 0; }
	mint(int _v) { v = (-MOD < _v && _v < MOD) ? _v : _v % MOD;
		if (v < 0) v += MOD; }
	friend bool operator==(const mint& a, const mint& b) {
		return a.v == b.v; }
	friend bool operator!=(const mint& a, const mint& b) {
		return !(a == b); }
	friend bool operator<(const mint& a, const mint& b) {
		return a.v < b.v; }
	friend void re(mint& a) { int x; re(x); a = mint(x); }
	friend string ts(mint a) { return ts(a.v); }

	mint& operator+=(const mint& m) {
		if ((v += m.v) >= MOD) v -= MOD;
		return *this; }
	mint& operator-=(const mint& m) {
		if ((v -= m.v) < 0) v += MOD;
		return *this; }
	mint& operator*=(const mint& m) {
		v = (int)v*m.v%MOD; return *this; }
	mint& operator/=(const mint& m) { return (*this) *= inv(m); }
	friend mint pow(mint a, int p) {
		mint ans = 1; assert(p >= 0);
		for (; p; p /= 2, a *= a) if (p&1) ans *= a;
		return ans; }
	friend mint inv(const mint& a) { assert(a.v != 0);
		return pow(a,MOD-2); }

	mint operator-() const { return mint(-v); }
	mint& operator++() { return *this += 1; }
	mint& operator--() { return *this -= 1; }
	friend mint operator+(mint a, const mint& b) { return a += b; }
	friend mint operator-(mint a, const mint& b) { return a -= b; }
	friend mint operator*(mint a, const mint& b) { return a *= b; }
	friend mint operator/(mint a, const mint& b) { return a /= b; }
};

typedef mint<MOD,5> mi; // 5 is primitive root for both common mods
typedef vector<mi> vmi;
typedef pair<mi,mi> pmi;
typedef vector<pmi> vpmi;

vector<vmi> scmb; // small combinations
void genComb(int SZ) {
	scmb.assign(SZ,vmi(SZ)); scmb[0][0] = 1;
	FOR(i,1,SZ) F0R(j,i+1)
		scmb[i][j] = scmb[i-1][j]+(j?scmb[i-1][j-1]:0);
}
ll comb(int a, int b) {
	if (a < b || b < 0) return 0;
	return fac[a]*ifac[b]%MOD*ifac[a-b]%MOD;
}
*//*
vi invs, fac, ifac;
void genFac(int SZ) { // pre-compute factorial mod inverses
	invs.resize(SZ), fac.resize(SZ), ifac.resize(SZ);
	invs[1] = fac[0] = ifac[0] = 1;
	FOR(i,2,SZ) invs[i] = MOD-MOD/i*invs[MOD%i]%MOD;
	FOR(i,1,SZ) {
		fac[i] = fac[i-1]*i%MOD;
		ifac[i] = ifac[i-1]*invs[i]%MOD;
	}
}
*/

int gcd(int a,int b) {  return b?gcd(b,a%b):a;}
void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }

void IOS(int n=10, string s=""){
  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  cout.precision(n); cerr.precision(n); cerr << fixed; cout << fixed;
  if (sz(s)) { setIn(s+".in"), setOut(s+".out"); }
}

const int mxN = 2e5;

void solve(){
	int n,d=1e9,d1=0,s=0; string ans; re(n); vi a(n),pa(n+1),c; re(a); F0R(i,n) pa[a[i]]=i;
	FOR(i,1,n+1){
		c.pb(pa[i]); chmin(d,pa[i]); chmax(d1,pa[i]);
		s+=pa[i];
		ld h1= (d1-d+1),h=h1/2,e=h*(d+d1);
		//sort(all(c)); vi d(sz(c)); iota(all(d),c[0]);
		if((int)e==s) ans+='1';
		else ans+='0';
	}
	ps(ans);
}
signed main(){
	IOS();
	int t=1; re(t);
	F0R(i,t){
		//pr("Case #",i+1,": ");
		solve();
	}
#ifdef __APPLE__
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
}


// HEADER FILES :
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include<unordered_set>
#include<ctime>
#include<random>
#include<chrono>
#include<iterator>
#include<unordered_map>

using namespace std;

// #DEFINE DEFINITIONS:
#define ll long long int
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORE(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,b,a) for(int i=b;i>a;i--)
#define FORDE(i,b,a) for(ll i=b;i>=a;i--)
#define DEBUG(x) cout<< '>'<<#x<<" : "<<x<<"\n"
#define nn cout<<"\n"
#define pb push_back
#define testcase int t;cin>>t;while(t--)
#define ld long double
#define gcd(a,b) __gcd(a,b)
#define space " "
#define maxv INT_MAX
#define minv INT_MIN
#define square(x) (x)*(x)
#define MOD 1000000007
#define FastIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define here cout<<"I'm here\n";
#define flush fflush(stdout)

// CUSTOM HASH FUNCTION :
/*
    unordered_map<long long, int, custom_hash> safe_map;
    gp_hash_table<long long, int, custom_hash> safe_hash_table;

*/
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

// DEBUGGING TEMPLATES :

void debug()
{
    cout<<endl;
}

template<class T1, class... Types> void debug(T1 e1, Types ... e2)
{
    cout<<e1<<" ";
    debug(e2...);
}

template<class T> void displayvector(vector<T> v)
{
    for(int i=0;i<v.size();i++)
    {
        cout<<v[i]<<space;
    }
    nn;
}

template<class T> void displayarray(T *v, int n)
{
    for(int i=0;i<n;i++)
    {
        cout<<v[i]<<space;
    }

    nn;
}

template<class T> int sizeofarr(T *v)
{
    return sizeof(v)/sizeof(T);
}

// ACTUAL CODE:

signed main(int argc, char** argv)
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    FastIO;
    testcase{
        ll n;
        cin>>n;
        unordered_map<ll,ll,custom_hash> mymap;
        FOR(i,0,n){
            ll temp;
            cin>>temp;
            mymap[temp] = i;
        }
        ll mi = INT_MAX;
        ll sumsofar = 0;
        string ans = "";
        FORE(i,1,n){
            sumsofar += mymap[i];
            mi = min(mi,mymap[i]);
            ll tmp = i*(i-1)*1ll;
            ll check1 = (2ll*(sumsofar - (i*mi*1ll)));
            if(check1 == tmp){
                ans += "1";
            }
            else{
                ans += "0";
            }
        }
        cout << ans <<"\n";
    }

    return 0;
}


// HEADER FILES :
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include<unordered_set>
#include<ctime>
#include<random>
#include<chrono>
#include<iterator>
#include<unordered_map>

using namespace std;

// #DEFINE DEFINITIONS:
#define ll long long int
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORE(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,b,a) for(int i=b;i>a;i--)
#define FORDE(i,b,a) for(ll i=b;i>=a;i--)
#define DEBUG(x) cout<< '>'<<#x<<" : "<<x<<"\n"
#define nn cout<<"\n"
#define pb push_back
#define testcase int t;cin>>t;while(t--)
#define ld long double
#define gcd(a,b) __gcd(a,b)
#define space " "
#define maxv INT_MAX
#define minv INT_MIN
#define square(x) (x)*(x)
#define MOD 1000000007
#define FastIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define here cout<<"I'm here\n";
#define flush fflush(stdout)

// CUSTOM HASH FUNCTION :
/*
    unordered_map<long long, int, custom_hash> safe_map;
    gp_hash_table<long long, int, custom_hash> safe_hash_table;

*/
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

// DEBUGGING TEMPLATES :

void debug()
{
    cout<<endl;
}

template<class T1, class... Types> void debug(T1 e1, Types ... e2)
{
    cout<<e1<<" ";
    debug(e2...);
}

template<class T> void displayvector(vector<T> v)
{
    for(int i=0;i<v.size();i++)
    {
        cout<<v[i]<<space;
    }
    nn;
}

template<class T> void displayarray(T *v, int n)
{
    for(int i=0;i<n;i++)
    {
        cout<<v[i]<<space;
    }

    nn;
}

template<class T> int sizeofarr(T *v)
{
    return sizeof(v)/sizeof(T);
}

// ACTUAL CODE:

signed main(int argc, char** argv)
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    FastIO;
    testcase{
        ll n;
        cin>>n;
        unordered_map<ll,ll> mymap;
        FOR(i,0,n){
            ll temp;
            cin>>temp;
            mymap[temp] = i;
        }
        ll mi = INT_MAX;
        ll sumsofar = 0;
        string ans = "";
        FORE(i,1,n){
            sumsofar += mymap[i];
            mi = min(mi,mymap[i]);
            if((2ll*((sumsofar*1ll) - (i*mi*1ll))) > (i*(i-1)*1ll)){
                ans += "0";
            }
            else{
                ans += "1";
            }
        }
        cout << ans <<"\n";
    }

    return 0;
}


// HEADER FILES :
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include<unordered_set>
#include<ctime>
#include<random>
#include<chrono>
#include<iterator>
#include<unordered_map>

using namespace std;

// #DEFINE DEFINITIONS:
#define ll long long int
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORE(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,b,a) for(int i=b;i>a;i--)
#define FORDE(i,b,a) for(ll i=b;i>=a;i--)
#define DEBUG(x) cout<< '>'<<#x<<" : "<<x<<"\n"
#define nn cout<<"\n"
#define pb push_back
#define testcase int t;cin>>t;while(t--)
#define ld long double
#define gcd(a,b) __gcd(a,b)
#define space " "
#define maxv INT_MAX
#define minv INT_MIN
#define square(x) (x)*(x)
#define MOD 1000000007
#define FastIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define here cout<<"I'm here\n";
#define flush fflush(stdout)

// CUSTOM HASH FUNCTION :
/*
    unordered_map<long long, int, custom_hash> safe_map;
    gp_hash_table<long long, int, custom_hash> safe_hash_table;

*/
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

// DEBUGGING TEMPLATES :

void debug()
{
    cout<<endl;
}

template<class T1, class... Types> void debug(T1 e1, Types ... e2)
{
    cout<<e1<<" ";
    debug(e2...);
}

template<class T> void displayvector(vector<T> v)
{
    for(int i=0;i<v.size();i++)
    {
        cout<<v[i]<<space;
    }
    nn;
}

template<class T> void displayarray(T *v, int n)
{
    for(int i=0;i<n;i++)
    {
        cout<<v[i]<<space;
    }

    nn;
}

template<class T> int sizeofarr(T *v)
{
    return sizeof(v)/sizeof(T);
}

// ACTUAL CODE:

signed main(int argc, char** argv)
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    FastIO;
    testcase{
        ll n;
        cin>>n;
        unordered_map<ll,ll> mymap;
        FOR(i,0,n){
            ll temp;
            cin>>temp;
            mymap[temp] = i+1;
        }
        ll mi = n+1;
        ll maxi = INT_MIN;
        string ans = "";
        FORE(i,1,n){
            mi = min(mi,mymap[i]);
            maxi = max(maxi,mymap[i]);
            if(maxi - mi + 1 == i){
                ans += "0";
            }
            else{
                ans += "1";
            }
        }
        cout << ans <<"\n";
    }

    return 0;
}


// HEADER FILES :
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include<unordered_set>
#include<ctime>
#include<random>
#include<chrono>
#include<iterator>
#include<unordered_map>

using namespace std;

// #DEFINE DEFINITIONS:
#define ll long long int
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORE(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,b,a) for(int i=b;i>a;i--)
#define FORDE(i,b,a) for(ll i=b;i>=a;i--)
#define DEBUG(x) cout<< '>'<<#x<<" : "<<x<<"\n"
#define nn cout<<"\n"
#define pb push_back
#define testcase int t;cin>>t;while(t--)
#define ld long double
#define gcd(a,b) __gcd(a,b)
#define space " "
#define maxv INT_MAX
#define minv INT_MIN
#define square(x) (x)*(x)
#define MOD 1000000007
#define FastIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define here cout<<"I'm here\n";
#define flush fflush(stdout)

// CUSTOM HASH FUNCTION :
/*
    unordered_map<long long, int, custom_hash> safe_map;
    gp_hash_table<long long, int, custom_hash> safe_hash_table;

*/
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

// DEBUGGING TEMPLATES :

void debug()
{
    cout<<endl;
}

template<class T1, class... Types> void debug(T1 e1, Types ... e2)
{
    cout<<e1<<" ";
    debug(e2...);
}

template<class T> void displayvector(vector<T> v)
{
    for(int i=0;i<v.size();i++)
    {
        cout<<v[i]<<space;
    }
    nn;
}

template<class T> void displayarray(T *v, int n)
{
    for(int i=0;i<n;i++)
    {
        cout<<v[i]<<space;
    }

    nn;
}

template<class T> int sizeofarr(T *v)
{
    return sizeof(v)/sizeof(T);
}

// ACTUAL CODE:

signed main(int argc, char** argv)
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    FastIO;
    testcase{
        ll n;
        cin>>n;
        unordered_map<ll,ll,custom_hash> mymap;
        FOR(i,0,n){
            ll temp;
            cin>>temp;
            mymap[temp] = i;
        }
        ll mi = INT_MAX;
        ll sumsofar = 0;
        string ans = "";
        FORE(i,1,n){
            sumsofar += mymap[i];
            mi = min(mi,mymap[i]);
            if((sumsofar - i*mi) == (i*(i-1))/2ll){
                ans += "1";
            }
            else{
                ans += "0";
            }
        }
        cout << ans <<"\n";
    }

    return 0;
}


// HEADER FILES :
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include<unordered_set>
#include<ctime>
#include<random>
#include<chrono>
#include<iterator>
#include<unordered_map>

using namespace std;

// #DEFINE DEFINITIONS:
#define ll long long int
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORE(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,b,a) for(int i=b;i>a;i--)
#define FORDE(i,b,a) for(ll i=b;i>=a;i--)
#define DEBUG(x) cout<< '>'<<#x<<" : "<<x<<"\n"
#define nn cout<<"\n"
#define pb push_back
#define testcase int t;cin>>t;while(t--)
#define ld long double
#define gcd(a,b) __gcd(a,b)
#define space " "
#define maxv INT_MAX
#define minv INT_MIN
#define square(x) (x)*(x)
#define MOD 1000000007
#define FastIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define here cout<<"I'm here\n";
#define flush fflush(stdout)

// CUSTOM HASH FUNCTION :
/*
    unordered_map<long long, int, custom_hash> safe_map;
    gp_hash_table<long long, int, custom_hash> safe_hash_table;

*/
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

// DEBUGGING TEMPLATES :

void debug()
{
    cout<<endl;
}

template<class T1, class... Types> void debug(T1 e1, Types ... e2)
{
    cout<<e1<<" ";
    debug(e2...);
}

template<class T> void displayvector(vector<T> v)
{
    for(int i=0;i<v.size();i++)
    {
        cout<<v[i]<<space;
    }
    nn;
}

template<class T> void displayarray(T *v, int n)
{
    for(int i=0;i<n;i++)
    {
        cout<<v[i]<<space;
    }

    nn;
}

template<class T> int sizeofarr(T *v)
{
    return sizeof(v)/sizeof(T);
}

// ACTUAL CODE:

signed main(int argc, char** argv)
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    FastIO;
    testcase{
        ll n;
        cin>>n;
        unordered_map<ll,ll,custom_hash> mymap;
        FOR(i,0,n){
            ll temp;
            cin>>temp;
            mymap[temp] = i;
        }
        ll mi = INT_MAX;
        ll sumsofar = 0;
        string ans = "";
        FORE(i,1,n){
            sumsofar += mymap[i];
            mi = min(mi,mymap[i]);
            if((2ll*(sumsofar - (1ll*i*mi))) == (1ll*i*(i-1))){
                ans += "1";
            }
            else{
                ans += "0";
            }
        }
        cout << ans <<"\n";
    }

    return 0;
}


// HEADER FILES :
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include<unordered_set>
#include<ctime>
#include<random>
#include<chrono>
#include<iterator>
#include<unordered_map>

using namespace std;

// #DEFINE DEFINITIONS:
#define ll long long int
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORE(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,b,a) for(int i=b;i>a;i--)
#define FORDE(i,b,a) for(ll i=b;i>=a;i--)
#define DEBUG(x) cout<< '>'<<#x<<" : "<<x<<"\n"
#define nn cout<<"\n"
#define pb push_back
#define testcase int t;cin>>t;while(t--)
#define ld long double
#define gcd(a,b) __gcd(a,b)
#define space " "
#define maxv INT_MAX
#define minv INT_MIN
#define square(x) (x)*(x)
#define MOD 1000000007
#define FastIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define here cout<<"I'm here\n";
#define flush fflush(stdout)

// CUSTOM HASH FUNCTION :
/*
    unordered_map<long long, int, custom_hash> safe_map;
    gp_hash_table<long long, int, custom_hash> safe_hash_table;

*/
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

// DEBUGGING TEMPLATES :

void debug()
{
    cout<<endl;
}

template<class T1, class... Types> void debug(T1 e1, Types ... e2)
{
    cout<<e1<<" ";
    debug(e2...);
}

template<class T> void displayvector(vector<T> v)
{
    for(int i=0;i<v.size();i++)
    {
        cout<<v[i]<<space;
    }
    nn;
}

template<class T> void displayarray(T *v, int n)
{
    for(int i=0;i<n;i++)
    {
        cout<<v[i]<<space;
    }

    nn;
}

template<class T> int sizeofarr(T *v)
{
    return sizeof(v)/sizeof(T);
}

// ACTUAL CODE:

signed main(int argc, char** argv)
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    FastIO;
    testcase{
        ll n;
        cin>>n;
        unordered_map<ll,ll> mymap;
        FOR(i,0,n){
            ll temp;
            cin>>temp;
            mymap[temp] = i+1;
        }
        ll mi = n+1;
        ll maxi = INT_MIN;
        string ans = "";
        FORE(i,1,n){
            mi = min(mi,mymap[i]);
            maxi = max(maxi,mymap[i]);
            if(maxi - mi + 1 == i){
                ans += "1";
            }
            else{
                ans += "0";
            }
        }
        cout << ans <<"\n";
    }

    return 0;
}


// HEADER FILES :
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include<unordered_set>
#include<ctime>
#include<random>
#include<chrono>
#include<iterator>
#include<unordered_map>

using namespace std;

// #DEFINE DEFINITIONS:
#define ll long long int
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORE(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,b,a) for(int i=b;i>a;i--)
#define FORDE(i,b,a) for(ll i=b;i>=a;i--)
#define DEBUG(x) cout<< '>'<<#x<<" : "<<x<<"\n"
#define nn cout<<"\n"
#define pb push_back
#define testcase int t;cin>>t;while(t--)
#define ld long double
#define gcd(a,b) __gcd(a,b)
#define space " "
#define maxv INT_MAX
#define minv INT_MIN
#define square(x) (x)*(x)
#define MOD 1000000007
#define FastIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#define here cout<<"I'm here\n";
#define flush fflush(stdout)

// CUSTOM HASH FUNCTION :
/*
    unordered_map<long long, int, custom_hash> safe_map;
    gp_hash_table<long long, int, custom_hash> safe_hash_table;

*/
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

// DEBUGGING TEMPLATES :

void debug()
{
    cout<<endl;
}

template<class T1, class... Types> void debug(T1 e1, Types ... e2)
{
    cout<<e1<<" ";
    debug(e2...);
}

template<class T> void displayvector(vector<T> v)
{
    for(int i=0;i<v.size();i++)
    {
        cout<<v[i]<<space;
    }
    nn;
}

template<class T> void displayarray(T *v, int n)
{
    for(int i=0;i<n;i++)
    {
        cout<<v[i]<<space;
    }

    nn;
}

template<class T> int sizeofarr(T *v)
{
    return sizeof(v)/sizeof(T);
}

// ACTUAL CODE:

signed main(int argc, char** argv)
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    FastIO;
    testcase{
        ll n;
        cin>>n;
        unordered_map<ll,ll,custom_hash> mymap;
        FOR(i,0,n){
            ll temp;
            cin>>temp;
            mymap[temp] = i;
        }
        ll mi = INT_MAX;
        ll sumsofar = 0;
        string ans = "";
        FORE(i,1,n){
            sumsofar += mymap[i];
            mi = min(mi,mymap[i]);
            if((2ll*(sumsofar - (i*mi*1ll))) == (i*(i-1)*1ll)){
                ans += "1";
            }
            else{
                ans += "0";
            }
        }
        cout << ans <<"\n";
    }

    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include<map>
#include<math.h>
#include<algorithm>
#include<set>

using namespace std;

const long long m = 1e6;
int p[m];
// int get(int v) {
//     if (v == p[v]) return v;
//     return p[v] = get(p[v]);
// }
// void unite(int a, int b) {
//     a = get(a); b = get(b);
//     p[a] = b;
// }

int get(int v) {
    if (p[v] == v) return v;
    return p[v] = get(p[v]);
}
void unite(int a, int b) {
    a = get(a); b = get(b);
    p[a] = b;
}

const int me = 10000;
vector<char> used(me);
vector<int> colors(me);
vector<int> ans;
int k = 0;
vector<vector<int>> adj(me);
vector<int> pm;
vector<char> cl;

int cycle_st, cycle_end;

bool dfs2 (int v) {
	cl[v] = 1;
	for (size_t i=0; i<adj[v].size(); ++i) {
		int to = adj[v][i];
		if (cl[to] == 0) {
			p[to] = v;
			if (dfs2 (to))  return true;
		}
		else if (cl[to] == 1) {
			cycle_end = v;
			cycle_st = to;
			return true;
		}
	}
	cl[v] = 2;
	return false;
}

 void dfs(int v) {
    used[v] = true;
    for (int i = 0; i < adj[v].size(); i ++) {
        if (!used[adj[v][i]]) {
            dfs(adj[v][i]);
        }
    }
    ans.push_back(v);

}

void dfs_graph_traverse() {
    int n,m; cin >> n >> m;
    bool flag = true;
    cl.assign (n + 1, 0);
    for (int i = 0; i < m; i ++){
        int x,y; cin >> x >> y;
        adj[x].push_back(y);
        if (find(adj[y].begin(), adj[y].end(), x) != adj[y].end()){
            flag = false;
        }
    }
    if (!flag) {
        cout << "No";
        return;
    }
    cycle_st = -1;

    for (int i = 1; i <= n; i++) {
            flag = dfs2(i);
            if (flag) break;
    }
    if (cycle_st != -1) {
        cout << "No";return;
    }
    for (int i = 1; i <= n; i ++){
        if (!used[i]) {
            dfs(i);
        }
    }

    cout << "Yes" << endl;
    reverse(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << " ";

    }

}
void solve(){
    int n; cin >> n;
    int arr[n + 1];
    int l, r = 0;
    bool p[n + 1];
    for (int i = 1; i <= n; i++) {
        cin >> arr[i];
        if (arr[i] == 1) {
            l = r = i;
        }
        p[i] = 0;
    }
    p[1] = 1;
    int m = 1;
    while(r - l <= n) {
        if (l - 1 >=1 && r +1 <= n && arr[l - 1] > arr[r + 1]) {
            r ++;
            m = max(m, arr[r]);
        }
        else {
            l--;
            m = max(m, arr[l]);
        }
        if (r - l + 1 == m) {
            p[m] = 1;
        }
    }
    p[n] = 1;
    for (int i = 1; i <= n;i ++) {
        cout << p[i];
    }
    cout << endl;

}

int main()
{
    // graph_traverse();
    // dfs_graph_traverse();
    int t; cin >> t;
    while (t--) {
        solve();

    }

}


#include <iostream>
#include <vector>
#include <string>
#include<map>
#include<math.h>
#include<algorithm>
#include<set>

using namespace std;

const long long m = 1e6;
int p[m];
// int get(int v) {
//     if (v == p[v]) return v;
//     return p[v] = get(p[v]);
// }
// void unite(int a, int b) {
//     a = get(a); b = get(b);
//     p[a] = b;
// }

int get(int v) {
    if (p[v] == v) return v;
    return p[v] = get(p[v]);
}
void unite(int a, int b) {
    a = get(a); b = get(b);
    p[a] = b;
}

const int me = 10000;
vector<char> used(me);
vector<int> colors(me);
vector<int> ans;
int k = 0;
vector<vector<int>> adj(me);
vector<int> pm;
vector<char> cl;

int cycle_st, cycle_end;

bool dfs2 (int v) {
	cl[v] = 1;
	for (size_t i=0; i<adj[v].size(); ++i) {
		int to = adj[v][i];
		if (cl[to] == 0) {
			p[to] = v;
			if (dfs2 (to))  return true;
		}
		else if (cl[to] == 1) {
			cycle_end = v;
			cycle_st = to;
			return true;
		}
	}
	cl[v] = 2;
	return false;
}

 void dfs(int v) {
    used[v] = true;
    for (int i = 0; i < adj[v].size(); i ++) {
        if (!used[adj[v][i]]) {
            dfs(adj[v][i]);
        }
    }
    ans.push_back(v);

}

void dfs_graph_traverse() {
    int n,m; cin >> n >> m;
    bool flag = true;
    cl.assign (n + 1, 0);
    for (int i = 0; i < m; i ++){
        int x,y; cin >> x >> y;
        adj[x].push_back(y);
        if (find(adj[y].begin(), adj[y].end(), x) != adj[y].end()){
            flag = false;
        }
    }
    if (!flag) {
        cout << "No";
        return;
    }
    cycle_st = -1;

    for (int i = 1; i <= n; i++) {
            flag = dfs2(i);
            if (flag) break;
    }
    if (cycle_st != -1) {
        cout << "No";return;
    }
    for (int i = 1; i <= n; i ++){
        if (!used[i]) {
            dfs(i);
        }
    }

    cout << "Yes" << endl;
    reverse(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << " ";

    }

}
void solve(){
    int n; cin >> n;
    int arr[n + 2];
    int l, r = 0;
    bool p[n + 1];
    for (int i = 1; i <= n; i++) {
        cin >> arr[i];
        if (arr[i] == 1) {
            l = r = i;
        }
        p[i] = 0;
    }
    p[1] = 1;
    int m = 1;
    arr[0] = INT_MAX;
    arr[n + 1] = INT_MIN;
    while(r - l <= n) {
        if (arr[l - 1] > arr[r + 1]) {
            r ++;
            m = max(m, arr[r]);
        }
        else {
            l--;
            m = max(m, arr[l]);
        }
        if (r - l + 1 == m) {
            p[m] = 1;
        }
    }
    p[n] = 1;
    for (int i = 1; i <= n;i ++) {
        cout << p[i];
    }
    cout << endl;

}

int main()
{
    // graph_traverse();
    // dfs_graph_traverse();
    int t; cin >> t;
    while (t--) {
        solve();

    }

}


#include <iostream>
#include <vector>
#include <string>
#include<map>
#include<math.h>
#include<algorithm>
#include<set>

using namespace std;

const long long m = 1e6;
int p[m];
// int get(int v) {
//     if (v == p[v]) return v;
//     return p[v] = get(p[v]);
// }
// void unite(int a, int b) {
//     a = get(a); b = get(b);
//     p[a] = b;
// }

int get(int v) {
    if (p[v] == v) return v;
    return p[v] = get(p[v]);
}
void unite(int a, int b) {
    a = get(a); b = get(b);
    p[a] = b;
}

const int me = 10000;
vector<char> used(me);
vector<int> colors(me);
vector<int> ans;
int k = 0;
vector<vector<int>> adj(me);
vector<int> pm;
vector<char> cl;

int cycle_st, cycle_end;

bool dfs2 (int v) {
	cl[v] = 1;
	for (size_t i=0; i<adj[v].size(); ++i) {
		int to = adj[v][i];
		if (cl[to] == 0) {
			p[to] = v;
			if (dfs2 (to))  return true;
		}
		else if (cl[to] == 1) {
			cycle_end = v;
			cycle_st = to;
			return true;
		}
	}
	cl[v] = 2;
	return false;
}

 void dfs(int v) {
    used[v] = true;
    for (int i = 0; i < adj[v].size(); i ++) {
        if (!used[adj[v][i]]) {
            dfs(adj[v][i]);
        }
    }
    ans.push_back(v);

}

void dfs_graph_traverse() {
    int n,m; cin >> n >> m;
    bool flag = true;
    cl.assign (n + 1, 0);
    for (int i = 0; i < m; i ++){
        int x,y; cin >> x >> y;
        adj[x].push_back(y);
        if (find(adj[y].begin(), adj[y].end(), x) != adj[y].end()){
            flag = false;
        }
    }
    if (!flag) {
        cout << "No";
        return;
    }
    cycle_st = -1;

    for (int i = 1; i <= n; i++) {
            flag = dfs2(i);
            if (flag) break;
    }
    if (cycle_st != -1) {
        cout << "No";return;
    }
    for (int i = 1; i <= n; i ++){
        if (!used[i]) {
            dfs(i);
        }
    }

    cout << "Yes" << endl;
    reverse(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << " ";

    }

}
void solve(){
    int n; cin >> n;
    int arr[n + 2];
    int l, r = 0;
    bool p[n + 1];
    for (int i = 1; i <= n; i++) {
        cin >> arr[i];
        if (arr[i] == 1) {
            l = r = i;
        }
        p[i] = 0;
    }
    p[1] = 1;
    int m = 1;
    arr[0] = INT_MAX;
    arr[n + 1] = INT_MIN;
    while(r - l <= n) {
        if (l - 1 >=1 && r +1 <= n && arr[l - 1] > arr[r + 1]) {
            r ++;
            m = max(m, arr[r]);
        }
        else {
            l--;
            m = max(m, arr[l]);
        }
        if (r - l + 1 == m) {
            p[m] = 1;
        }
    }
    p[n] = 1;
    for (int i = 1; i <= n;i ++) {
        cout << p[i];
    }
    cout << endl;

}

int main()
{
    // graph_traverse();
    // dfs_graph_traverse();
    int t; cin >> t;
    while (t--) {
        solve();

    }

}


    #include <iostream>
    #include <vector>
    #include <string>
    #include<map>
    #include<algorithm>
    #include <algorithm>
    #include<set>
    #include<queue>
    #include <iomanip>

    #include<deque>
    #include <cmath>
    #include<list>
    typedef long long ll;
    #define mp make_pair
    #define pb push_back
    #define vi vector <int>
    #define ld long double
    #define pii pair<int, int>
    #define forn(i, n) for(int i = 0; i < int(n); i++)

    using namespace std;

    bool isPrime(int n)
    {
            if (n <= 1)
            return false;
        if (n <= 3)
            return true;

        if (n % 2 == 0 || n % 3 == 0)
            return false;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;

        return true;
    }

    const ll m = 1e6 + 7;

    int fib[m];
    int p[m];
    int weight[m];
    int ans = 0;
    int sz[m];
    bool used[m];

int get(int v) {
    if (v == p[v]) return v;
    return p[v] = get(p[v]);
}
void unite(int a, int b) {
    a = get(a); b = get(b);
    p[a] = b;
}

void solve1() {
	string s;cin >> s;
	char last;
	string res = "";
	bool flag = true;
	for (int i = 1; i < s.size(); i ++) {
	    if (s[i] != '?' && s[i] == s[i - 1])
	    flag = false;
	}
	if (!flag) {
	    cout << -1 << endl;
	    return;
	}
	char arr[3] = {'a','b','c'};
	for (int i = 0; i < s.size(); i ++) {
	    if (s[i] == '?') {
	        int j = 0;
	        s[i] = 'a';
	        while ((i - 1 >= 0 && s[i] == s[i - 1]) || (i + 1 < s.size() && s[i] == s[i + 1])) {
	            if (j == 3) {
	                flag = false;
	                break;
	            }
	            s[i] = arr[j];
	            j++;
	        }
	    }
	}
	if (!flag) {
	    cout << -1 << endl;
	    return;
	}
	cout << s << endl;
}
void solve2() {
    int n; cin >> n;
    int arr[n + 1];
    bool c[n + 1];
    map<int,int>m;
    for (int i  = 1; i <= n; i ++) {
        c[i] = 0;

    }
    c[1] = 1;
    c[n] = 1;

    int index =0 ;
    for (int i = 1; i <= n; i ++) {
        cin >> arr[i];
        m[arr[i]] = i;
        if (arr[i] == 1) index = i;
    }
    int l = -1, r = - 1;
    for (int i = 1; i < n; i ++) {
        l = index - i;
        r = index + i;
        if (l < 1) l = 1; if (r > n) r = n;
        int k = i + 1;
        int val = 0;
        int temp_index = -1;
        for (int q = l; q <= r; q++) {
            if (arr[q] <= k) {
                if (temp_index != - 1 && q-temp_index != 1){
                    break;
                }
                temp_index = q;
                val++;

            }
        }
        if (val == k) c[i + 1] = 1;
    }
    for (int i = 1; i <= n; i ++) {
        cout << c[i];
    }
    cout << endl;
}

void solve3() {
    int n; cin >> n;
    int arr[n];
    for (int i = 0; i < n; i ++) {
        cin >> arr[i];
    }
    int max_num = 0;
    int max_el = arr[0];
    int max_ind = -1;
    for (int i = 0; i < n; i ++) {
        if (arr[i] == max_el) {
            max_num ++;
            max_ind = i;
        }
        else break;
    }
    int division = n / 2;
    int min_num = 0;
    int min_el = arr[division - 1];
    int min_ind = -1;
    for (int i = division - 1; i >=0; i --) {
        if (arr[i] == min_el) {
            min_num ++;
            min_ind = i;
        }
        else break;
    }
    int g = (min_ind - max_ind) - 1;
    if (max_num <= 0 || g <= 0 || min_num <= 0) cout << 0 << " " << 0 << " " << 0 << endl;
    else
    cout << max_num << " " << (min_ind - max_ind) - 1 << " " << min_num << endl;

}

void solve4() {
    int a,b,c,d; cin >> a >> b >> c >> d;
    map<int, int> m;
    m[0] = a;
    m[1] = b;
    m[2] = c;
    m[3] = d;
    m[4] = 0;
    string s = "";
    int j = 0;
    while(m[j] == 0) {
        j++;
    }
    bool flag = true;
    for (int i = 0; i < (a + b + c + d); i ++) {
        s += to_string(j);
        m[j] --;

        if (m[j - 1] > 0) {
            j--;
        }
        else if (m[j + 1] > 0){
            j++;
        }
        else  {break;flag = false;}
    }
    for (int i = 0; i <= 3;i++){
        if (m[i] !=0) flag = false;
    }
    if (!flag) { cout << "NO" << endl; return;}
    cout << "YES"  << endl;
    for (int i = 0; i < s.size(); i ++) {
        cout << s[i] << " ";
    }

}

int main()
{
    int t; cin >> t;
    while (t--) {

    solve2();
 }

}


#include <iostream>
#include <vector>
#include <string>
#include<map>
#include<math.h>
#include<algorithm>
#include<set>

using namespace std;

const long long m = 1e6;
int p[m];
// int get(int v) {
//     if (v == p[v]) return v;
//     return p[v] = get(p[v]);
// }
// void unite(int a, int b) {
//     a = get(a); b = get(b);
//     p[a] = b;
// }

int get(int v) {
    if (p[v] == v) return v;
    return p[v] = get(p[v]);
}
void unite(int a, int b) {
    a = get(a); b = get(b);
    p[a] = b;
}

const int me = 10000;
vector<char> used(me);
vector<int> colors(me);
vector<int> ans;
int k = 0;
vector<vector<int>> adj(me);
vector<int> pm;
vector<char> cl;

int cycle_st, cycle_end;

bool dfs2 (int v) {
	cl[v] = 1;
	for (size_t i=0; i<adj[v].size(); ++i) {
		int to = adj[v][i];
		if (cl[to] == 0) {
			p[to] = v;
			if (dfs2 (to))  return true;
		}
		else if (cl[to] == 1) {
			cycle_end = v;
			cycle_st = to;
			return true;
		}
	}
	cl[v] = 2;
	return false;
}

 void dfs(int v) {
    used[v] = true;
    for (int i = 0; i < adj[v].size(); i ++) {
        if (!used[adj[v][i]]) {
            dfs(adj[v][i]);
        }
    }
    ans.push_back(v);

}

void dfs_graph_traverse() {
    int n,m; cin >> n >> m;
    bool flag = true;
    cl.assign (n + 1, 0);
    for (int i = 0; i < m; i ++){
        int x,y; cin >> x >> y;
        adj[x].push_back(y);
        if (find(adj[y].begin(), adj[y].end(), x) != adj[y].end()){
            flag = false;
        }
    }
    if (!flag) {
        cout << "No";
        return;
    }
    cycle_st = -1;

    for (int i = 1; i <= n; i++) {
            flag = dfs2(i);
            if (flag) break;
    }
    if (cycle_st != -1) {
        cout << "No";return;
    }
    for (int i = 1; i <= n; i ++){
        if (!used[i]) {
            dfs(i);
        }
    }

    cout << "Yes" << endl;
    reverse(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << " ";

    }

}
void solve(){
    int n; cin >> n;
    int arr[n + 2];
    int l, r = 0;
    bool p[n + 1];
    for (int i = 1; i <= n; i++) {
        cin >> arr[i];
        if (arr[i] == 1) {
            l = r = i;
        }
        p[i] = 0;
    }
    p[1] = 1;
    int m = 1;
    arr[0] = INT_MAX;
    arr[n + 1] = INT_MAX;
    while(r - l + 1<= n) {
        if (arr[l - 1] > arr[r + 1]) {
            r ++;
            m = max(m, arr[r]);
        }
        else {
            l--;
            m = max(m, arr[l]);
        }
        if (r - l + 1 == m) {
            p[m] = 1;
        }
    }
    p[n] = 1;
    for (int i = 1; i <= n;i ++) {
        cout << p[i];
    }
    cout << endl;

}

int main()
{
    // graph_traverse();
    // dfs_graph_traverse();
    int t; cin >> t;
    while (t--) {
        solve();

    }

}


#include <iostream>
#include <vector>
#include <string>
#include<map>
#include<math.h>
#include<algorithm>
#include<set>

using namespace std;

const long long m = 1e6;
int p[m];
// int get(int v) {
//     if (v == p[v]) return v;
//     return p[v] = get(p[v]);
// }
// void unite(int a, int b) {
//     a = get(a); b = get(b);
//     p[a] = b;
// }

int get(int v) {
    if (p[v] == v) return v;
    return p[v] = get(p[v]);
}
void unite(int a, int b) {
    a = get(a); b = get(b);
    p[a] = b;
}

const int me = 10000;
vector<char> used(me);
vector<int> colors(me);
vector<int> ans;
int k = 0;
vector<vector<int>> adj(me);
vector<int> pm;
vector<char> cl;

int cycle_st, cycle_end;

bool dfs2 (int v) {
	cl[v] = 1;
	for (size_t i=0; i<adj[v].size(); ++i) {
		int to = adj[v][i];
		if (cl[to] == 0) {
			p[to] = v;
			if (dfs2 (to))  return true;
		}
		else if (cl[to] == 1) {
			cycle_end = v;
			cycle_st = to;
			return true;
		}
	}
	cl[v] = 2;
	return false;
}

 void dfs(int v) {
    used[v] = true;
    for (int i = 0; i < adj[v].size(); i ++) {
        if (!used[adj[v][i]]) {
            dfs(adj[v][i]);
        }
    }
    ans.push_back(v);

}

void dfs_graph_traverse() {
    int n,m; cin >> n >> m;
    bool flag = true;
    cl.assign (n + 1, 0);
    for (int i = 0; i < m; i ++){
        int x,y; cin >> x >> y;
        adj[x].push_back(y);
        if (find(adj[y].begin(), adj[y].end(), x) != adj[y].end()){
            flag = false;
        }
    }
    if (!flag) {
        cout << "No";
        return;
    }
    cycle_st = -1;

    for (int i = 1; i <= n; i++) {
            flag = dfs2(i);
            if (flag) break;
    }
    if (cycle_st != -1) {
        cout << "No";return;
    }
    for (int i = 1; i <= n; i ++){
        if (!used[i]) {
            dfs(i);
        }
    }

    cout << "Yes" << endl;
    reverse(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << " ";

    }

}
void solve(){
    int n; cin >> n;
    int arr[n + 1];
    int l, r = 0;
    bool p[n + 1];
    for (int i = 1; i <= n; i++) {
        cin >> arr[i];
        if (arr[i] == 1) {
            l = r = i;
        }
        p[i] = 0;
    }
    p[1] = 1;
    int m = 1;
    while(r - l <= n) {
        if (arr[l - 1] > arr[r + 1]) {
            r ++;
            m = max(m, arr[r]);
        }
        else {
            l--;
            m = max(m, arr[l]);
        }
        if (r - l + 1 == m) {
            p[m] = 1;
        }
    }
    p[n] = 1;
    for (int i = 1; i <= n;i ++) {
        cout << p[i];
    }
    cout << endl;

}

int main()
{
    // graph_traverse();
    // dfs_graph_traverse();
    int t; cin >> t;
    while (t--) {
        solve();

    }

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        int p[n];
        int st = -1, l = -1, r = n;
        for (int i = 0; i < n; i++)
        {
            cin >> p[i];
            if (p[i] == 1)
            {
                st = i;
            }
        }
        l = st - 1;
        r = st + 1;
        set<int> s;
        int ans[n + 1];
        int cnt = 1;
        s.insert(1);
        ans[1] = 1;
        while (cnt != n)
        {
            if (l == -1 || (l != -1 && p[l] > p[r]))
            {
                s.insert(p[r]);
                if (*s.rbegin() == s.size())
                {
                    ans[s.size()] = 1;
                }
                else
                    ans[s.size()] = 0;
                cnt++;
                r++;
                continue;
            }
            if (r == n || (r != n && p[l] > p[r]))
            {
                s.insert(p[l]);
                if (*s.rbegin() == s.size())
                {
                    ans[s.size()] = 1;
                }
                else
                    ans[s.size()] = 0;
                cnt++;
                l--;
                continue;
            }
        }
        for (int i = 1; i <= n; i++)
        {
            cout << ans[i];
        }
        cout << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        int p[n];
        int st = -1, l = -1, r = -1;
        for (int i = 0; i < n; i++)
        {
            cin >> p[i];
            if (p[i] == 1)
            {
                st = i;
            }
        }
        if (st != 0)
            l = st - 1;
        if (st != n - 1)
            r = st + 1;
        set<int> s;
        int ans[n + 1];
        int cnt = 1;
        s.insert(1);
        ans[1] = 1;
        while (cnt != n)
        {
            if (l == -1 || p[l] > p[r])
            {
                s.insert(p[r]);
                if (*s.rbegin() == s.size())
                {
                    ans[s.size()] = 1;
                }
                else
                    ans[s.size()] = 0;
                cnt++;
                r++;
                continue;
            }
            if (r == -1 || p[r] > p[l])
            {
                s.insert(p[l]);
                if (*s.rbegin() == s.size())
                {
                    ans[s.size()] = 1;
                }
                else
                    ans[s.size()] = 0;
                cnt++;
                l--;
                continue;
            }
        }
        for (int i = 1; i <= n; i++)
        {
            cout << ans[i];
        }
        cout << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        int p[n];
        int st = -1, l = -1, r = n;
        for (int i = 0; i < n; i++)
        {
            cin >> p[i];
            if (p[i] == 1)
            {
                st = i;
            }
        }
        l = st - 1;
        r = st + 1;
        set<int> s;
        int ans[n + 1] = {0};
        int cnt = 1;
        s.insert(1);
        ans[1] = 1;
        while (cnt != n)
        {
            if (l == -1 || p[l] > p[r])
            {
                s.insert(p[r]);
                if (*s.rbegin() == s.size())
                    ans[s.size()] = 1;
                cnt++;
                r++;
                continue;
            }
            if (r == n || p[r] > p[l])
            {
                s.insert(p[l]);
                if (*s.rbegin() == s.size())
                    ans[s.size()] = 1;
                cnt++;
                l--;
                continue;
            }
        }
        for (int i = 1; i <= n; i++)
        {
            cout << ans[i];
        }
        cout << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        int p[n];
        int st = -1, l = -1, r = n;
        for (int i = 0; i < n; i++)
        {
            cin >> p[i];
            if (p[i] == 1)
            {
                st = i;
            }
        }
        l = st - 1;
        r = st + 1;
        set<int> s;
        int ans[n + 1];
        int cnt = 1;
        s.insert(1);
        ans[1] = 1;
        while (cnt != n)
        {
            if (l == -1 || (l != -1 && p[l] > p[r]))
            {
                s.insert(p[r]);
                if (*s.rbegin() == s.size())
                {
                    ans[s.size()] = 1;
                }
                else
                    ans[s.size()] = 0;
                cnt++;
                r++;
                continue;
            }
            if (r == n || (r != n && p[r] > p[l]))
            {
                s.insert(p[l]);
                if (*s.rbegin() == s.size())
                {
                    ans[s.size()] = 1;
                }
                else
                    ans[s.size()] = 0;
                cnt++;
                l--;
                continue;
            }
        }
        for (int i = 1; i <= n; i++)
        {
            cout << ans[i];
        }
        cout << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        int p[n];
        int st = -1, l = -1, r = n;
        for (int i = 0; i < n; i++)
        {
            cin >> p[i];
            if (p[i] == 1)
            {
                st = i;
            }
        }
        l = st - 1;
        r = st + 1;
        set<int> s;
        int ans[n + 1];
        int cnt = 1;
        s.insert(1);
        ans[1] = 1;
        while (cnt != n)
        {
            if (l == -1 || p[l] > p[r])
            {
                s.insert(p[r]);
                if (*s.rbegin() == s.size())
                {
                    ans[s.size()] = 1;
                }
                else
                    ans[s.size()] = 0;
                cnt++;
                r++;
                continue;
            }
            if (r == n || p[r] > p[l])
            {
                s.insert(p[l]);
                if (*s.rbegin() == s.size())
                {
                    ans[s.size()] = 1;
                }
                else
                    ans[s.size()] = 0;
                cnt++;
                l--;
                continue;
            }
        }
        for (int i = 1; i <= n; i++)
        {
            cout << ans[i];
        }
        cout << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        int p[n];
        int st = -1, l = -1, r = n;
        for (int i = 0; i < n; i++)
        {
            cin >> p[i];
            if (p[i] == 1)
            {
                st = i;
            }
        }
        l = st - 1;
        r = st + 1;
        set<int> s;
        int ans[n + 1] = {0};
        int cnt = 1;
        s.insert(1);
        ans[1] = 1;
        while (cnt != n)
        {
            if (l == -1)
            {
                s.insert(p[r]);
                r++;
            }
            else if (r == n)
            {
                s.insert(p[l]);
                l--;
            }
            else if(p[l] > p[r])
            {
                s.insert(p[r]);
                r++;
            }
            else
            {
                s.insert(p[l]);
                l--;
            }
            if (*s.rbegin() == s.size())
                    ans[s.size()] = 1;
            cnt++;
        }
        for (int i = 1; i <= n; i++)
        {
            cout << ans[i];
        }
        cout << "\n";
    }
}


#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define pob pop_back
#define vl vector<ll>
#define mp make_pair
#define sz size()
#define fast ios::sync_with_stdio(0);cin.tie(NULL); cout.tie(NULL)
#define maxx 100005
#define mod 1000000007
#define edge pair<ll,ll>
using namespace std;

// ¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++¦¦¦++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++++++¦¦¦¦¦¦¦¦¦¦+++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++¦¦¦¦¦+++++++¦++¦¦
// ¦¦¦¦¦¦¦¦++¦¦¦¦¦¦++++++¦¦¦¦+++++++++++++¦
// ¦¦¦¦¦¦¦++++++¦¦¦++++++¦¦++++++++++++++¦¦
// ¦¦¦¦¦¦¦+++++++¦¦¦+++++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++¦¦¦¦¦¦¦¦¦++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++¦¦¦¦¦¦¦¦+++++++¦
// ¦¦¦¦¦¦¦¦¦¦++¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦++++¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++++++¦¦+¦++¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++¦¦+++++¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+¦¦¦¦+++¦¦¦¦++++++¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++¦¦+¦¦¦¦¦+++++++¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++++++++++¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++¦¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+¦¦¦+++++++++++¦¦¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++¦¦¦¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++¦¦¦¦¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++¦¦¦¦¦¦¦¦¦¦¦¦

int main()
{
	fast;
	ll t;
	cin>>t;
	while(t--)
	{
		ll n;
		ll i;
		cin>>n;
		ll a[n];
		ll pos[n];

		for(i=1;i<=n;i++)
		{
			cin>>a[i];
			pos[a[i]]=i;
		}
		ll l,r;
		string ans="1";
		l=r=pos[1];
		for(i=2;i<=n;i++)
		{
			l=min(l,pos[i]);
			r=max(r,pos[i]);
			if(r-l+1==i)
			ans+='1';
			else
			ans+='0';
		}
		cout<<ans<<"\n";
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define pob pop_back
#define vl vector<ll>
#define mp make_pair
#define sz size()
#define fast ios::sync_with_stdio(0)
#define maxx 100005
#define mod 1000000007
#define edge pair<ll,ll>
using namespace std;

// ¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++¦¦¦++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++++++¦¦¦¦¦¦¦¦¦¦+++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++¦¦¦¦¦+++++++¦++¦¦
// ¦¦¦¦¦¦¦¦++¦¦¦¦¦¦++++++¦¦¦¦+++++++++++++¦
// ¦¦¦¦¦¦¦++++++¦¦¦++++++¦¦++++++++++++++¦¦
// ¦¦¦¦¦¦¦+++++++¦¦¦+++++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++¦¦¦¦¦¦¦¦¦++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++¦¦¦¦¦¦¦¦+++++++¦
// ¦¦¦¦¦¦¦¦¦¦++¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦++++¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++++++++++++++¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++++++¦¦+¦++¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++¦¦+++++¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+¦¦¦¦+++¦¦¦¦++++++¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++¦¦+¦¦¦¦¦+++++++¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++++++++++¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++++++++++¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++++¦¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+¦¦¦+++++++++++¦¦¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦+++++++++¦¦¦¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++++¦¦¦¦¦¦¦¦¦¦
// ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦++++++¦¦¦¦¦¦¦¦¦¦¦¦

int main()
{
	fast;
	cin.tie(0);
	ll t;
	cin>>t;
	while(t--)
	{
		ll n;
		ll i;
		cin>>n;
		ll a[n];
		ll pos[n];

		for(i=1;i<=n;i++)
		{
			cin>>a[i];
			pos[a[i]]=i;
		}
		ll l,r;
		string ans="1";
		l=r=pos[1];
		for(i=2;i<=n;i++)
		{
			l=min(l,pos[i]);
			r=max(r,pos[i]);
			if(r-l+1==i)
			ans=ans+'1';
			else
			ans=ans+'0';
		}
		cout<<ans<<"\n";
	}
	return 0;
}