For this Question: N children are standing in a queue. They are standing in order 1 to N. Heights of all the children are given. For each child find the length of longest subarray in which all the children have height greater than or equal to him. He must also be part of that sub-array.First Line of input contains integer N denoting number of children.
Next line contain N integers denoting height of ith child H[i].

Constraints
1 <= N <= 150000
0 <= H[i] <= 100000Print N space separated integersSample Input
5
1 2 3 4 2

Sample Output
5 4 2 1 4

Explanation: 
For index 1 sub-array is from 1 to 5 
For index 2 sub-array is from 2 to 5
For index 3 sub-array is from 3 to 4
For index 4 sub-array is from 4 to 4
For index 5 sub-array is from 2 to 5

Sample Input
3
6 5 8

Sample Output
1 3 1, I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;

#define pu push_back
#define fi first
#define se second
#define mp make_pair
#define int long long
#define pii pair<int,int>
#define mm (s+e)/2
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(int i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define sz 200000
vector<int> A;
vector<pii> B;
int ans[200005],ans1[200005];

#define qw1 freopen("input1.txt", "r", stdin); freopen("output1.txt", "w", stdout);
#define qw2 freopen("input2.txt", "r", stdin); freopen("output2.txt", "w", stdout);
#define qw3 freopen("input3.txt", "r", stdin); freopen("output3.txt", "w", stdout);
#define qw4 freopen("input4.txt", "r", stdin); freopen("output4.txt", "w", stdout);
#define qw5 freopen("input5.txt", "r", stdin); freopen("output5.txt", "w", stdout);
#define qw6 freopen("input6.txt", "r", stdin); freopen("output6.txt", "w", stdout);
#define qw freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

signed main()
{
	
		int n;
		cin>>n;
		for(int i=0;i<n;i++)
		{ 
           int a;
           cin>>a;
           A.pu(0-a);
		}

		B.pu(mp(10000000,-1));
		for(int i=0;i<n;i++)
		{
		  pii x=B.back();
		  while(A[i]>=x.fi)
		  {
		  	B.pop_back();
		  	x=B.back();
		  }
		  x=B.back();
		  B.pu(mp(A[i],i));
		  ans[i]=x.se+1;
		}
		B.resize(0);
		B.pu(mp(1000000,n));
		for(int i=n-1;i>=0;i--)
		{
			 pii x=B.back();
		  while(A[i]>=x.fi)
		  {
		  	B.pop_back();
		  	x=B.back();
		  }
		  x=B.back();
		  B.pu(mp(A[i],i));
		  ans1[i]=x.se+1;
		}
		for(int i=0;i<n;i++)
		{
			cout<<ans1[i]-ans[i]-1<<" ";
		}

	
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?