For this Question: Given an array Arr of N integers. Find the number of subarrays of this array that are powerful.
A subarray [L, R] (1 <= L <= R <= N) is said to be powerful if the product A<sub>L</sub> * A<sub>L+1</sub> * ... * A<sub>R-1</sub> * A<sub>R</sub> is odd.The first line of input contains a single integer N
The second line of input contains N integers representing the elements of the array Arr
 
<b>Constraints </b>
1  <= N <= 100000
1 <= Arr[i] <= 100000Output the number of powerful subarrays of array Arr.Sample Input 1 
5
2 4 4 5 3 

Sample output 1
3

Sample Input 2
3
1 5 1 

Sample Output 2
6

<b>Explanation:</b>
(3), (5), (3, 5) are the required subarrays.
(1), (2), (1), (1, 5), (5, 1]) (1, 5, 1) are the required subarrays., I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
    cin>>a[i];
}
long cnt=0;
long ans=0;
for(int i=0;i<n;i++){
    if(a[i]&1){cnt++;}
    else{
        ans+=(cnt*(cnt+1))/2;
        cnt=0;
    }
}

        ans+=(cnt*(cnt+1))/2;
        cout<<ans;
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?