Language: C

#include <stdio.h>
#define MAX 100000
#define MIHARI 2000000000


struct A{
    char point;
    int value;
};

struct A left[MAX/2+2],right[MAX/2+2];

void merge(struct A M,int n,int le,int mi,int ri){
    int i,j,k;
    int n1 = mi - le;
    int n2 = ri - mi;
    for(i=0;i<n1;i++) left[i] = M[le + i];
    for(i=0;i<n2;i++) right[i] = M[mi + i];
    left[n1].value = right[n2].value = MIHARI ;
    i=0;
    j=0;
    for(k=le;k<ri;k++){
        if(left[i].value <= right[j].value){
            M[k] = left[i++];
        }else{
            M[k] = right[j++];
        }
    }
}

void mergeS(struct A M,int n,int le,int ri){
    if(le+1 < ri){
        int mid = (le+ri)/2;
        mergeS(M,n,le,mid);
        mergeS(M,n,mid,ri);
        merge(M,n,le,mid,ri);
    }
}

int par(struct A M,int n,int p,int r){
    int i,j;
    struct A t,x;
    x = M[r];
    i = p - 1;
    for(j=p;j<r;j++){
        if(M[j].value <= x.value){
            i++;
            t = M[i];
            M[i] = M[j];
            M[j] = t;
        }
    }
    t = M[i+1];
    M[i+1] = M[r];
    M[r] = t;
    return i+1;
}

void quick(struct A M,int n,int p,int r){
    int q;
    if(q<r){
        q=par(M,n,p,r);
        quick(M,n,p,q-1);
        quick(M,n,q+1,r);
    }
}

int main(){
    int n,i,x;
    struct A M[MAX],Y[MAX];
    char S[10];
    int c = 1;
    
    scanf("%d",&n);
    
    for(i=0;i<n;i++){
        scanf("%s%d",S,&x);
        M[i].point = Y[i].point = S[0];
        M[i].value = Y[i].value = x;
    }
    
    mergeS(M,n,0,n);
    quick(Y,n,0,n-1);
    
    for(i=0;i<n;i++){
        if(M[i].point != Y[i].point) c=0;
    }
    
    if(c==1) printf("Stable\n");
    for(i=0;i<n;i++){
        printf("%c%d\n",Y[i].point,Y[i].value);
    }
    return 0;
}









Compiler output:
main.c: In function 'merge':
main.c:17:34: error: subscripted value is neither array nor pointer nor vector
   17 |     for(i=0;i<n1;i++) left[i] = M[le + i];
      |                                  ^
main.c:18:35: error: subscripted value is neither array nor pointer nor vector
   18 |     for(i=0;i<n2;i++) right[i] = M[mi + i];
      |                                   ^
main.c:24:14: error: subscripted value is neither array nor pointer nor vector
   24 |             M[k] = left[i++];
      |              ^
main.c:26:14: error: subscripted value is neither array nor pointer nor vector
   26 |             M[k] = right[j++];
      |              ^
main.c: In function 'par':
main.c:43:10: error: subscripted value is neither array nor pointer nor vector
   43 |     x = M[r];
      |          ^
main.c:46:13: error: subscripted value is neither array nor pointer nor vector
   46 |         if(M[j].value <= x.value){
      |             ^
main.c:48:18: error: subscripted value is neither array nor pointer nor vector
   48 |             t = M[i];
      |                  ^
main.c:49:14: error: subscripted value is neither array nor pointer nor vector
   49 |             M[i] = M[j];
      |              ^
main.c:49:21: error: subscripted value is neither array nor pointer nor vector
   49 |             M[i] = M[j];
      |                     ^
main.c:50:14: error: subscripted value is neither array nor pointer nor vector
   50 |             M[j] = t;
      |              ^
main.c:53:10: error: subscripted value is neither array nor pointer nor vector
   53 |     t = M[i+1];
      |          ^
main.c:54:6: error: subscripted value is neither array nor pointer nor vector
   54 |     M[i+1] = M[r];
      |      ^
main.c:54:15: error: subscripted value is neither array nor pointer nor vector
   54 |     M[i+1] = M[r];
      |               ^
main.c:55:6: error: subscripted value is neither array nor pointer nor vector
   55 |     M[r] = t;
      |      ^
main.c: In function 'main':
main.c:82:12: error: incompatible type for argument 1 of 'mergeS'
   82 |     mergeS(M,n,0,n);
      |            ^
      |            |
      |            struct A *
main.c:31:22: note: expected 'struct A' but argument is of type 'struct A *'
   31 | void mergeS(struct A M,int n,int le,int ri){
      |             ~~~~~~~~~^
main.c:83:11: error: incompatible type for argument 1 of 'quick'
   83 |     quick(Y,n,0,n-1);
      |           ^
      |           |
      |           struct A *
main.c:59:21: note: expected 'struct A' but argument is of type 'struct A *'
   59 | void quick(struct A M,int n,int p,int r){
      |            ~~~~~~~~~^