You push the stack arrand color. Presumably, when your call is scanfcommented out, the compiler deletes all these variables, but when it is present, it tries to allocate memory on the stack.
Make the variables global and read in stack memory versus heap memory.
#include<stdio.h>
int arr[10002][10002];
int color[10002];
int main()
{
int neigh;
scanf("%d",&neigh);
return 0;
}
source
share