I am getting a 255 error in codeblocks while compiling this code....its giving me filename.exe stopped working...but I'm getting the output in ubuntu
my code...
#include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
long long int n,k=0;
scanf("%lld",&n);
long long int a[n],b[1000000]={0};
int i;
for(i=0;i<n;i++)
{
scanf("%lld",&a[i]);
b[a[i]]++;
}
long long int count=0;
for(i=1;i<=1000000;i++)
{
if(b[i]>0)
count+=(b[i]*(b[i]+1))/2;
}
printf("%lld\n",count);
}
return 0;
}
i/p 2 4 1 2 3 4 3 1 2 1 o/p 4 4