Can you please check what is wrong with this code

#include<bits/stdc++.h>
using namespace std;

int main() {
int n;
cin>>n;
long long int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
long long int sum=0;
long long int count =0;
map<long long int,long long int> m;
for(int i=0;i<n;i++){
sum = sum + a[i];
if(m.find(sum)!=m.end()){
m[sum]++;
}else{
m[sum]=1;
}
}
for(auto it: m){
if(it.first==0){
count+=(it.second*(it.second-1))/2 + it.second;
}
else{
if(it.second>1){
count+= (it.second*(it.second-1))/2;
}
}
}
cout<<count<<endl;
return 0;
}

hello @varss777 please wait i am checking your code.

hey @varss777 what is the error that you are getting?

your code seems perfectly fine to me.
if you facing any issue could you please share the hackerblocks link of this question.
i will try to submit it.