#include <bits/stdc++.h>
using namespace std;
#define f(i, x, n) for(int i = x; i < (int)(n); ++i)
#define ll long long
const int N = 1000005;
int q, a[200001], c[200001];
pair <int, int> b[200001];
int main(){
int n;
cin >> q;
while(q--){
cin >> n;
for(int i = 1; i <= n; ++i){
scanf("%d", &a[i]);
b[i] = make_pair(a[i], i);
}
c[1] = 1;
sort(b + 1, b + n + 1);
int mn = 2000000, mx = 1;
for(int i = 1; i <= n; ++i){
mx = max(mx, b[i].second);
mn = min(mn, b[i].second);
if(mx - mn == i - 1){
c[i] = 1;
}
else{
c[i] = 0;
}
}
for(int i = 1; i <= n; ++i){
cout << c[i];
}
cout << endl;
}
return 0;}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgZihpLCB4LCBuKSBmb3IoaW50IGkgPSB4OyBpIDwgKGludCkobik7ICsraSkKI2RlZmluZSBsbCBsb25nIGxvbmcKY29uc3QgaW50IE4gPSAxMDAwMDA1OwppbnQgcSwgYVsyMDAwMDFdLCBjWzIwMDAwMV07CnBhaXIgPGludCwgaW50PiBiWzIwMDAwMV07CmludCBtYWluKCl7CglpbnQgbjsKICAgIGNpbiAgPj4gcTsKICAgIHdoaWxlKHEtLSl7CiAgICAJY2luID4+IG47CiAgICAJZm9yKGludCBpID0gMTsgaSA8PSBuOyArK2kpewogICAgCQlzY2FuZigiJWQiLCAmYVtpXSk7CiAgICAJCWJbaV0gPSBtYWtlX3BhaXIoYVtpXSwgaSk7CiAgICAJfQogICAgCWNbMV0gPSAxOwogICAgCXNvcnQoYiArIDEsIGIgKyBuICsgMSk7CiAgICAJaW50IG1uID0gMjAwMDAwMCwgbXggPSAxOwogICAgCWZvcihpbnQgaSA9IDE7IGkgPD0gbjsgKytpKXsKICAgIAkJbXggPSBtYXgobXgsIGJbaV0uc2Vjb25kKTsKICAgIAkJbW4gPSBtaW4obW4sIGJbaV0uc2Vjb25kKTsKICAgIAkJaWYobXggLSBtbiA9PSBpIC0gMSl7CiAgICAJCQljW2ldID0gMTsKICAgIAkJfQogICAgCQllbHNlewogICAgCQkJY1tpXSA9IDA7CiAgICAJCX0KICAgIAl9CiAgICAJZm9yKGludCBpID0gMTsgaSA8PSBuOyArK2kpewogICAgCQljb3V0IDw8IGNbaV07CiAgICAJfQogICAgCWNvdXQgPDwgZW5kbDsKICAgIH0KICAgIHJldHVybiAwO30KICAgICAgICAK