Counting Sort - Run Time Error

Here’s my code, How can I overcome runtime problem
#include
#include
#include
using namespace std;
int main() {
int n;
cin>>n;
int range;
int a[n];

for(int i=0;i<n;i++){
    cin>>a[i];
    
}

     int list[10005] = {0};

 for(int i=0;i<n;i++){
  
    list[a[i]] += 1 ;
}

range = sizeof(list)/sizeof(int);

//cout<<range;
for(int i=0;i<range;i++){
if(list[i]!=0){
for(int j=0;j<list[i];j++){
cout<<i<<endl;
}
}
}

}

https://ide.codingblocks.com/s/56798

take bigger size list

Hey Lakshay, as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required. And please mark your doubts as resolved in your course’s " Ask Doubt " section, when your doubt is resolved.

I have marked it as resolved many times but it keep coming back to unresolved. Is there any way i can do that explicitly?