i was trying problem practice(easy) "voters" my code is giving runtime error.

i used a array .in that array value increment according to id. after all inputs it is checking at with index value is grater than 2.

int a[50001];
#include<stdio.h>
int main(){
	int n1,n2,n3,i,n,count=0;
	scanf("%d %d %d",&n1,&n2,&n3);
	if((n1<0 || n1>50000)||(n2<0 || n2>50000)||(n3<0 || n3>50000)){
	exit(1);
	}
	for(i=1;i<=50000;i++){
		a[i]=0;

	}
	for(i=1;i<=n1;i++){
		scanf("%d",&n);
		a[n]++;
	}
	for(i=1;i<=n2;i++){
		scanf("%d",&n);
		a[n]++;
	}
	for(i=1;i<=n3;i++){
		scanf("%d",&n);
		a[n]++;
	}
	for(i=1;i<=50000;i++){
		if(a[i]>=2){
			count++;
		}
	}
	printf("%d\n",count);
	for(i=1;i<=50000;i++){
		if(a[i]>=2){
			printf("%d\n",i);
		}
	}
	return 0;
}

What type of runtime error are u getting?

The problem is, that you are assuming, that n <= 50.000, but according to second comment (from admin) it’s not.