For this Question: Sara loves problems on permutation but this time she stuck on a problem and asks for your help.
Given a permutation of N integers as Arr[], your task is to check for each K(1 <= K <= N) there exists a subarray of size K such that it is also a permutation of K integers.

Note:- A permutation of N integers is a sequence of size N where every element from 1- N are present.The first line of input contains a single integer N denoting the size of permutation, the next line of input contains N space separated integers depicting the permutaiton.

Constraints:- 
1 <= N <= 100000
1 <= Arr[i] <= NPrint N space separated integers either 1 or 0. Print 1 if there exist a permutation K for the ith number else print 0.Sample Input:-
6
4 5 1 3 2 6

Sample Output:-
1 0 1 0 1 1

Explanation:-
for k=1 permutaion exist from [3, 3]
for k=2 no permutaion exists
for k=3 permutaion exist from [3, 5]
for k=4 no permutaion exists
for k=5 permutaion exist from [1, 5]
for k=6 permutaion exist from [1, 6]

Sample Input:-
6
6 5 4 3 2 1

Sample Output:-
1 1 1 1 1 1, I have written this Solution Code: #include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795
#define max1 1001
#define MOD 1000000007

#define read(type) readInt<type>()

#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'
#define int long long
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}


    pair<int,int> ans[100005];
signed main(){
   //    freopen("ou.txt", "r", stdin);

//     freopen("output.txt", "w", stdout);
int t;t=1;
while(t--){
    int n;
    cin>>n;
    int a[n+10];
    int b[n+10];
    FOR(i,n){
    cin>>a[i];
    b[a[i]]=i;
    }
    
    ans[1].first=b[1];
    ans[1].second=b[1];
    for(int i=2;i<=n;i++){
        ans[i].first=min(ans[i-1].first,b[i]);

        ans[i].second=max(ans[i-1].second,b[i]);
    }
    for(int i=1;i<=n;i++){
    if(ans[i].second-ans[i].first+1==i){cout<<1<<" ";}
    else{
        cout<<0<<" ";
    }
    }
    END;
}
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?