portrayed by a variety of integers an of length n. You are currently refreshing the foundation, so you've made a program to pack these diagrams. The program functions as follows. Given an integer boundary k, the program takes the base of each adjoining subarray of length k in a. All the more officially, for a cluster an of length n and an integer
Correct answer will be upvoted else Multiple Downvoted. Don't submit random answer. Computer science.
each individual has a rating chart portrayed by a variety of integers an of length n. You are currently refreshing the foundation, so you've made a
The program functions as follows. Given an integer boundary k, the program takes the base of each adjoining subarray of length k in a.
All the more officially, for a cluster an of length n and an integer k, characterize the k-pressure exhibit of an as a cluster b of length n−k+1, to such an extent that
bj=minj≤i≤j+k−1ai
For instance, the 3-pressure cluster of [1,3,4,5,2] is [min{1,3,4},min{3,4,5},min{4,5,2}]=[1,3,2].
A stage of length m is an exhibit comprising of m unmistakable integers from 1 to m in subjective request. For instance, [2,3,1,5,4] is a stage, however [1,2,2] isn't a change (2 shows up twice in the exhibit) and [1,3,4] is likewise not a stage (m=3 but rather there is 4 in the cluster).
A k-pressure cluster will fulfill CodeCook clients if it will be a stage. Given a cluster a, decide for all 1≤k≤n if CodeCook clients will be glad after a k-pressure of this exhibit or not.
Input
The main line contains a solitary integer t (1≤t≤104) — the number of experiments.
The principal line of the portrayal of each experiment contains a solitary integer n (1≤n≤3⋅105) — the length of the cluster.
The second line of the depiction of each experiment contains n integers a1,… ,an (1≤
It is ensured, that the amount of n for all experiments doesn't surpass 3⋅105.
Output
For each experiment, print a paired line of length n.
The k-th character of the string ought to be 1 if CodeCook clients will be glad after a k-pressure of the cluster a, and 0 in any case.
Step by step
Solved in 4 steps with 1 images