My code is correct

Code is correct but it is showing run error, tell me why?

you can see my code in my submission https://online.codingblocks.com/app/player/80000/content/150294/4917/code-challenge

Hey @mayurjhode55
Please share your code in Coding Blocks Ide,We can’t access your submissions :slight_smile:

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
void merge(ll *a,ll s,ll e){
ll mid=(s+e)/2;
ll i=s,j=mid+1,k=s,a1[1000];
while(i<=mid && j<=e){
if(a[i]<=a[j]){
a1[k++]=a[i++];
}
else{
a1[k++]=a[j++];
}
}
while(i<=mid){
a1[k++]=a[i++];
}
while(j<=e){
a1[k++]=a[j++];
}
for(ll i=s;i<=e;i++){
a[i]=a1[i];
}
}
void merge_sort(ll *a,ll s,ll e){
if(s>=e){
return ;
}
ll mid=(s+e)/2;
merge_sort(a,s,mid);
merge_sort(a,mid+1,e);
merge(a,s,e);
}
int main(){
ll n;
cin>>n;
ll a[n];
for(ll i=0;i<n;i++){
cin>>a[i];
}
merge_sort(a,0,n-1);
for(ll i=0;i<n;i++){
cout<<a[i]<<" ";
}
return 0;
}

Please check this code it is showing run error

Hey @mayurjhode55

I asked u to share in IDE

It is showing run error when i submit it to coding blocks

Hey @mayurjhode55
Did 3 corrections and mentioned the changes in comments :https://ide.codingblocks.com/s/338891