For this Question: In Newton City, there are N buildings in a line. A building is considered good if the height of the building is greater than or equal to all the buildings in its right side. 
Given the height of N buildings in the line, your task is to print the good buildings in the same order as they are given.

Note:- The rightmost building will always be good as their is no building in its right sideThe first line of input contains a single integer N. The next line of input contains N space- separated integers depicting the values of the array.

Constraints:-
1 <= N <= 100000
1 <= Arr[i] <= 100000Print all the good buildings as they appear in the array.Sample Input:-
6
3 7 4 1 2 1

Sample Output:-
7 4 2 1

Explanation:-
There is no greater element than 7 4 2 1 on their right side.

Sample Input:-
5
1 2 3 4 5

Sample Output:-
5, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
    cin>>a[i];
}
vector<int> v;
int x = -1;
for(int i=n-1;i>=0;i--){
    if(a[i]>=x){
        x=a[i];
        v.emplace_back(a[i]);
    }
}
for(int i=v.size()-1;i>=0;i--){
    cout<<v[i]<<" ";
}
    }
, In this Programming Language: C++, Now tell me if this Code is compilable or not?