For this Question: Given an array A[] of size N and an integer K. Print the count of distinct numbers in all subarrays of size k in the array A[].The first line of input contains two integers N and K. The next line contains N space separated values of the array A[].

Constraints:-
1 <= N, K <= 100000
1 <= A[] <= 1000000000Print the space separated values denoting counts of distinct numbers in all subarrays of size k in the array A[].Sample Input :
7 4
1 2 1 3 4 2 3

Sample Output:
3 4 4 3

Explanation:-`
First window's elements is:- 1 2 1 3 which contains 3 different elements.
Second window's elements is:- 2 1 3 4 which contains 4 different elements.
Third window's elements is:- 1 3 4 2 which contains 4 different elements.
Fourth window's elements is:- 3 4 2 3 which contains 3 different elements., I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
int main(){

unordered_map<long,int> m;
int n,k;
cin>>n>>k;
long a[n];
for(int i=0;i<n;i++){cin>>a[i];}
for(int i=0;i<k;i++){
m[a[i]]++;
}
cout<<m.size()<<" ";
int ans=m.size();
for(int i=k;i<n;i++){
    m[a[i-k]]--;
    if(m[a[i-k]]==0){ans--;}
    m[a[i]]++;
    if(m[a[i]]==1){ans++;}
    cout<<ans<<" ";
}

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