criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <stdio.h>
#define MAX 500000
#define INFTY 100000000
void merge(int *, int, int, int);
void mergesort(int *, int, int);
int count = 0;

int main()
{
  int i, n;
  int s[MAX];

  scanf("%d", &n);

  for(i=0; i<n; i++) {
    scanf("%d", &s[i]);
  }
  
  mergesort(s, 0, n);

  for(i=0; i<n; i++) {
    if(i != n-1)
      printf("%d ", s[i]);
    else
      printf("%d\n%d\n", s[i], count);
  }

  free(s);

  return 0;
}

void merge(int *a, int left, int mid, int right)
{
  int n1, n2, i, j, k;
  int l[MAX/2+2], r[MAX/2+2;

  n1 = mid-left;
  n2 = right-mid;

  for(i=0; i<n1; i++) {
    l[i] = a[left+i];
  }
  for(i=0; i<n2; i++) {
    r[i] = a[mid+i];
  }
  l[n1] = INFTY;
  r[n2] = INFTY;
  i = 0;
  j = 0;
  for(k=left; k<right; k++) {
    count++;
    if(l[i] <= r[j]) {
      a[k] = l[i++];
    }
    else {
      a[k] = r[j++];
    }
  }
}

void mergesort(int *a, int left, int right) {
  int mid;
  if(left+1 < right) {
    mid = (left+right)/2;
    mergesort(a, left, mid);
    mergesort(a, mid, right);
    merge(a, left, mid, right);
  }
}

Compiler output:
main.c: In function 'main':
main.c:28:3: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   28 |   free(s);
      |   ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'free'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | #define MAX 500000
main.c:28:3: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
   28 |   free(s);
      |   ^~~~
main.c:28:3: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c: In function 'merge':
main.c:36:28: error: expected ']' before ';' token
   36 |   int l[MAX/2+2], r[MAX/2+2;
      |                            ^
      |                            ]
main.c:70:1: error: expected declaration or statement at end of input
   70 | }
      | ^
Language: C

#include <stdio.h>
#define MAX 500000
#define INFTY 100000000
void merge(int *, int, int, int);
void mergesort(int *, int, int);
int count = 0;

int main()
{
  int i, n;
  int s[MAX];

  scanf("%d", &n);

  for(i=0; i<n; i++) {
    scanf("%d", &s[i]);
  }
  
  mergesort(s, 0, n);

  for(i=0; i<n; i++) {
    if(i != n-1)
      printf("%d ", s[i]);
    else
      printf("%d\n%d\n", s[i], count);
  }

  return 0;
}

void merge(int *a, int left, int mid, int right)
{
  int n1, n2, i, j, k;
  int l[MAX/2+2], r[MAX/2+2;

  n1 = mid-left;
  n2 = right-mid;

  for(i=0; i<n1; i++) {
    l[i] = a[left+i];
  }
  for(i=0; i<n2; i++) {
    r[i] = a[mid+i];
  }
  l[n1] = INFTY;
  r[n2] = INFTY;
  i = 0;
  j = 0;
  for(k=left; k<right; k++) {
    count++;
    if(l[i] <= r[j]) {
      a[k] = l[i++];
    }
    else {
      a[k] = r[j++];
    }
  }
}

void mergesort(int *a, int left, int right) {
  int mid;
  if(left+1 < right) {
    mid = (left+right)/2;
    mergesort(a, left, mid);
    mergesort(a, mid, right);
    merge(a, left, mid, right);
  }
}

Compiler output:
main.c: In function 'merge':
main.c:34:28: error: expected ']' before ';' token
   34 |   int l[MAX/2+2], r[MAX/2+2;
      |                            ^
      |                            ]
main.c:68:1: error: expected declaration or statement at end of input
   68 | }
      | ^
Language: C

#include<stdio.h>
#include<math.h>
#define n 1000000
#define element 20000000000
int A[n],c=0;
void Merge(int,int,int);
void MergeSort(int,int);
int main(){
  int i,m;
  scanf("%d",&A[i]);
  Mergesort(0,m);
  for(i=0;i<n;i++){
    printf("%d",A[i]);
    if(i!=n-1)printf(" ");
  }
  printf("\n%d\n",c);
  return 0;
}
void Merge(int left,int mid,int right)
{
  int n1,n2,i,j,k,L[n],R[n];

  n1 = mid - left;
  n2 = right - mid;
  for(i=0;i<=n1-1;i++) 
    L[i] = A[left + i]
  
      for(i=0;i<=n1-1;i++)
	R[i] = A[mid + i]
  
	  L[n1] = element;
  R[n2] = element;
  i = 0;
  j = 0;

  for (k=left;k<=right-1;k++)
    if (L[i] <= R[j]){
      A[k] = L[i];
      i = i + 1;
      c++;
    }
    else{
      A[k] = R[j];
      j = j + 1
	c++;
    }
  MergeSort(int left,int right){
    int mid;
    if (left+1 < right){
      mid = (left + right)/2;
      Merge-Sort(A, left, mid);
      Merge-Sort(A, mid, right);
      Merge(A, left, mid, right);
    }
  }

Compiler output:
main.c: In function 'main':
main.c:11:3: error: implicit declaration of function 'Mergesort'; did you mean 'MergeSort'? [-Wimplicit-function-declaration]
   11 |   Mergesort(0,m);
      |   ^~~~~~~~~
      |   MergeSort
main.c: In function 'Merge':
main.c:26:23: error: expected ';' before 'for'
   26 |     L[i] = A[left + i]
      |                       ^
      |                       ;
   27 | 
   28 |       for(i=0;i<=n1-1;i++)
      |       ~~~              
main.c:4:17: warning: overflow in conversion from 'long int' to 'int' changes value from '20000000000' to '-1474836480' [-Woverflow]
    4 | #define element 20000000000
      |                 ^~~~~~~~~~~
main.c:32:11: note: in expansion of macro 'element'
   32 |   R[n2] = element;
      |           ^~~~~~~
main.c:44:16: error: expected ';' before 'c'
   44 |       j = j + 1
      |                ^
      |                ;
   45 |         c++;
      |         ~       
main.c:47:13: error: expected expression before 'int'
   47 |   MergeSort(int left,int right){
      |             ^~~
main.c:47:3: error: too few arguments to function 'MergeSort'
   47 |   MergeSort(int left,int right){
      |   ^~~~~~~~~
main.c:7:6: note: declared here
    7 | void MergeSort(int,int);
      |      ^~~~~~~~~
main.c:47:32: error: expected ';' before '{' token
   47 |   MergeSort(int left,int right){
      |                                ^
      |                                ;
main.c:55:3: error: expected declaration or statement at end of input
   55 |   }
      |   ^
Language: C

#include<stdio.h>
#define N  6000000
void merge(int*,int,int,int);
void mergeSort(int*,int,int);
int count,n;
int main(){
  int i;
  int s[N];
  int mid,left,right;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&s[i]);
  }
  left = 0;
  right = n;
  count=0;
  mergeSort(s,left,right);
  printf("%d",s[0]);
  for(i=1;i<n;i++) printf(" %d",s[i]);
  printf("\n");
  printf("%d\n",count);
  return 0;
}

void merge(int *A,int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1 = mid - left;
  n2 = right - mid;
  int L[n1],R[n2];
  for(i=0;i<n1;i++) L[i] = A[left + i];
  for(j=0;j<n2;j++) R[j] = A[mid + j];
  L[n1] = ;
  R[n2] = ;
  i = 0;
  j = 0;
  for(k=left;k<right;k++){
    if(L[i] <= R[j]){
      A[k] = L[i];
      i++;
      count++;
    }else{
      A[k] = R[j];
      j++;
      count++;
    }
  }
}

void mergeSort(int *A,int left, int right){
  int mid,i;
  if (left+1 < right){
    mid = (left + right)/2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  }
}

Compiler output:
main.c: In function 'merge':
main.c:33:11: error: expected expression before ';' token
   33 |   L[n1] = ;
      |           ^
main.c:34:11: error: expected expression before ';' token
   34 |   R[n2] = ;
      |           ^
Language: C

#include <stdio.h>

#define N 500000

int A[N],R[N/2+2],L[N/2+2];
int c;
void merge(int*,int,int,int);
void mergeSort(int*,int,int);

int main(){

  int n,i,j;
  int left,right;

  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%d",&A[i]);
  }

  left = 0;
  right = n;

  mergeSort(A,left,right);

  for(i=0; i<n-1; i++){
    printf("%d ",A[i]);
  }
  printf("%d\n",A[n-1]);

  printf("%d\n",c);

  return 0;
}

void merge(int* A,int left,int mid,int right){

  int n1,n2,i,j,k;

  n1 = mid - left;
  n2 = right - mid;

  for(i=0; i<n1; i++){
    L[i] = A[left+i];
  }

  for(i=0; i<n2; i++){
    R[i] = A[mid+i];
  }
  L[n1] = ;
  R[n2] = ;

  i=0;
  j=0;

  for(k = left; k < right; k++){
    if(L[i] <= R[j]){
      A[k] = L[i];
      i++;
      c++;
    }
    else{
      A[k] = R[j];
      j++;
      c++;
    }
  }

}

void mergeSort(int* A,int left,int right){

  int mid;

  if(left+1 < right){
    mid = (left + right)/2;
    mergeSort(A,left,mid);
    mergeSort(A,mid,right);
    merge(A,left,mid,right);
  }
}

Compiler output:
main.c: In function 'merge':
main.c:49:11: error: expected expression before ';' token
   49 |   L[n1] = ;
      |           ^
main.c:50:11: error: expected expression before ';' token
   50 |   R[n2] = ;
      |           ^
Language: C

#include<stdio.h>

#define MAX 50000
#define SENTINEL 2000000000

int cnt;
int L[(MAX/2)+2];
int R[(MAX/2)+2];

void marge(int[],int,int,int);
void margeSort(int[],int,int);


int main()
{
  int n,A[MAX],i;
  cnt=0;
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&A[i]);

  margeSort(A,0,n);

  for(i=0;i<n;i++)
    {
      printf("%d\n",A[i]);
    }
  printf("%d\n",cnt);

  return 0;
}

void marge(int A[],int left,int mid,int right)
{
  int i,j,k,n1,n2;

   n1=mid-left;
   n2=right-mid;
  for(i=0;i<n1;i++)L[i]=A[left+i];
  for(i=0;i<n2;i++)R[i]=A[mid+i];
  L[n1]=SENTINEL;
  R[n2]=SENTINEL;
  i=0;
  j=0;
  for(k=left;k<right;k++)
    {
      cnt++;
      if(L[i]<=R[j]){
	A[k]=L[i++];
      }
      else {
	A[k]=R[j++];
      }
    }
}

Compiler output:
/usr/bin/ld: /tmp/ccqv2DxE.o: in function `main':
main.c:(.text+0x83): undefined reference to `margeSort'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 500000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=N;
    R[n2]=N;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}
void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/ccxAAZzB.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccxAAZzB.o
/tmp/ccxAAZzB.o: in function `merge':
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccxAAZzB.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccxAAZzB.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccxAAZzB.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccxAAZzB.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccxAAZzB.o
main.c:(.text+0x298): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccxAAZzB.o
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 500000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=N;
    R[n2]=N;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/ccY2RN3A.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccY2RN3A.o
/tmp/ccY2RN3A.o: in function `merge':
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccY2RN3A.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccY2RN3A.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccY2RN3A.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccY2RN3A.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccY2RN3A.o
main.c:(.text+0x298): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccY2RN3A.o
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 500000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n;i++){
    printf("%d ",S[i]);
  }
  printf("\n%d\n",count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=N;
    R[n2]=N;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/ccqut5Io.o: in function `main':
main.c:(.text+0xc3): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccqut5Io.o
/tmp/ccqut5Io.o: in function `merge':
main.c:(.text+0x184): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccqut5Io.o
main.c:(.text+0x1c2): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccqut5Io.o
main.c:(.text+0x1e8): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccqut5Io.o
main.c:(.text+0x1f1): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccqut5Io.o
main.c:(.text+0x21c): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccqut5Io.o
main.c:(.text+0x27e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccqut5Io.o
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 500000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=N;
    R[n2]=N;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/ccJpETSc.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccJpETSc.o
/tmp/ccJpETSc.o: in function `merge':
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccJpETSc.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccJpETSc.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccJpETSc.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccJpETSc.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccJpETSc.o
main.c:(.text+0x298): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccJpETSc.o
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 2147483647
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=N;
    R[n2]=N;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/cceE84e9.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/cceE84e9.o
/tmp/cceE84e9.o: in function `merge':
main.c:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cceE84e9.o
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cceE84e9.o
main.c:(.text+0x1c1): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cceE84e9.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cceE84e9.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/cceE84e9.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/cceE84e9.o
main.c:(.text+0x21f): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cceE84e9.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cceE84e9.o
main.c:(.text+0x265): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cceE84e9.o
main.c:(.text+0x298): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 2147483646
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=N;
    R[n2]=N;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/ccOAG6Xa.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccOAG6Xa.o
/tmp/ccOAG6Xa.o: in function `merge':
main.c:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccOAG6Xa.o
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccOAG6Xa.o
main.c:(.text+0x1c1): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccOAG6Xa.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccOAG6Xa.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccOAG6Xa.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccOAG6Xa.o
main.c:(.text+0x21f): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccOAG6Xa.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccOAG6Xa.o
main.c:(.text+0x265): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccOAG6Xa.o
main.c:(.text+0x298): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 4000000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=N;
    R[n2]=N;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/cc1OyDn8.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/cc1OyDn8.o
/tmp/cc1OyDn8.o: in function `merge':
main.c:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cc1OyDn8.o
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cc1OyDn8.o
main.c:(.text+0x1c1): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cc1OyDn8.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cc1OyDn8.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/cc1OyDn8.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/cc1OyDn8.o
main.c:(.text+0x21f): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cc1OyDn8.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cc1OyDn8.o
main.c:(.text+0x265): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cc1OyDn8.o
main.c:(.text+0x298): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 4000000000
#define INF 400000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=INF;
    R[n2]=INF;
    i=0;
    j=0;

  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}
void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/ccTwBYUc.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccTwBYUc.o
/tmp/ccTwBYUc.o: in function `merge':
main.c:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccTwBYUc.o
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccTwBYUc.o
main.c:(.text+0x1c1): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccTwBYUc.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccTwBYUc.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccTwBYUc.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccTwBYUc.o
main.c:(.text+0x21f): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccTwBYUc.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccTwBYUc.o
main.c:(.text+0x265): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccTwBYUc.o
main.c:(.text+0x298): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 4000000000
#define INF 400000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=INF;
    R[n2]=INF;
    i=0;
    j=0;
for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/cc2LdT4s.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/cc2LdT4s.o
/tmp/cc2LdT4s.o: in function `merge':
main.c:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cc2LdT4s.o
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cc2LdT4s.o
main.c:(.text+0x1c1): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cc2LdT4s.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cc2LdT4s.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/cc2LdT4s.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/cc2LdT4s.o
main.c:(.text+0x21f): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cc2LdT4s.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cc2LdT4s.o
main.c:(.text+0x265): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cc2LdT4s.o
main.c:(.text+0x298): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 4000000000
#define INF 400000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=INF;
    R[n2]=INF;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/ccjrhMM2.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccjrhMM2.o
/tmp/ccjrhMM2.o: in function `merge':
main.c:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccjrhMM2.o
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccjrhMM2.o
main.c:(.text+0x1c1): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccjrhMM2.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccjrhMM2.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccjrhMM2.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccjrhMM2.o
main.c:(.text+0x21f): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccjrhMM2.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccjrhMM2.o
main.c:(.text+0x265): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccjrhMM2.o
main.c:(.text+0x298): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 4000000000
#define INF 200000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=INF;
    R[n2]=INF;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/ccjD79fz.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccjD79fz.o
/tmp/ccjD79fz.o: in function `merge':
main.c:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccjD79fz.o
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccjD79fz.o
main.c:(.text+0x1c1): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccjD79fz.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccjD79fz.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccjD79fz.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccjD79fz.o
main.c:(.text+0x21f): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccjD79fz.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccjD79fz.o
main.c:(.text+0x265): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccjD79fz.o
main.c:(.text+0x298): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 4000000000
#define INF 200000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=N;
    R[n2]=N;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/ccUjNUoJ.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccUjNUoJ.o
/tmp/ccUjNUoJ.o: in function `merge':
main.c:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccUjNUoJ.o
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccUjNUoJ.o
main.c:(.text+0x1c1): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccUjNUoJ.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccUjNUoJ.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccUjNUoJ.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccUjNUoJ.o
main.c:(.text+0x21f): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccUjNUoJ.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccUjNUoJ.o
main.c:(.text+0x265): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccUjNUoJ.o
main.c:(.text+0x298): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 4000000000
#define INF 200000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=INF;
    R[n2]=INF;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/ccCjE4fg.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccCjE4fg.o
/tmp/ccCjE4fg.o: in function `merge':
main.c:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccCjE4fg.o
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccCjE4fg.o
main.c:(.text+0x1c1): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccCjE4fg.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccCjE4fg.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccCjE4fg.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/ccCjE4fg.o
main.c:(.text+0x21f): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccCjE4fg.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccCjE4fg.o
main.c:(.text+0x265): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccCjE4fg.o
main.c:(.text+0x298): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 4000000000
#define INF 200000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=INF;
    R[n2]=INF;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
return 0;
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
main.c: In function 'merge':
main.c:49:8: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   49 | return 0;
      |        ^
main.c:22:6: note: declared here
   22 | void merge(int S[],int left,int mid,int right){
      |      ^~~~~
Language: C

#include <stdio.h>
#define N 4000000000
#define INF 200000000
int S[N],L[N],R[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=INF;
    R[n2]=INF;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
/tmp/cc9s9sph.o: in function `main':
main.c:(.text+0xc6): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/cc9s9sph.o
/tmp/cc9s9sph.o: in function `merge':
main.c:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cc9s9sph.o
main.c:(.text+0x19e): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cc9s9sph.o
main.c:(.text+0x1c1): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cc9s9sph.o
main.c:(.text+0x1dc): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cc9s9sph.o
main.c:(.text+0x202): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/cc9s9sph.o
main.c:(.text+0x20b): relocation truncated to fit: R_X86_64_PC32 against symbol `count' defined in .bss section in /tmp/cc9s9sph.o
main.c:(.text+0x21f): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cc9s9sph.o
main.c:(.text+0x236): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cc9s9sph.o
main.c:(.text+0x265): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/cc9s9sph.o
main.c:(.text+0x298): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 500000
#define INF 200000000
int S[N];
int count=0;
void merge(int[],int,int,int);
void mergeSort(int[],int ,int);
int main()
{
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  mergeSort(S,0,n);
  for(i =0;i<n-1;i++){
    printf("%d ",S[i]);
  }
  printf("%d\n%d\n",S[i],count);
  return 0;
}
void merge(int S[],int left,int mid,int right){
  int n1,n2;
  int i,j,k;
  int L[n1,R[n2];
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=S[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=S[mid+j];
  }
    L[n1]=INF;
    R[n2]=INF;
    i=0;
    j=0;
  
  for(k=left;k<right;k++){
    count++;
    if(L[i]<R[j]){
      S[k]=L[i];
      i=i+1;
    }
      else {
      S[k]=R[j];
      j=j+1;
      }
  }
}

void mergeSort(int S[],int left,int right){
  int mid;
  if(left+1<right){
    mid = (left + right)/2;
    mergeSort(S,left,mid);
    mergeSort(S,mid,right);
    merge(S,left,mid,right);
  }
}

Compiler output:
main.c: In function 'merge':
main.c:25:11: error: expected ']' before ',' token
   25 |   int L[n1,R[n2];
      |           ^
      |           ]
main.c:60:1: error: expected declaration or statement at end of input
   60 | }
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>

#define N 500000
#define N 2000000000

int cnt;
int n;

void merge(int*, int, int, int);
void merge_sort(int*, int, int);

int main(){

  int i, a[N];

  cnt = 0;

  scanf("%d",&n);

  for(i=0;i<n;i++)scanf("%d",&a[i]);
  
  merge_sort(a, 0, i);

  printf("%d",a[0]);

  for(i=1;i<n;i++)printf(" %d",a[i]);

  printf("\n%d\n",cnt);

  return 0;
}
void merge(int *a, int left, int mid, int  right){
  int n1, n2, i, k, j;
  int L[n], R[n];

  n1 = mid - left;
  n2 = right - mid;

  for(i=0;i<n1;i++)L[i] = a[left + i];
  
  for(i=0;i<n2;i++)R[i] = a[mid + i];

  L[n1] = INFTY;
  R[n2] = INFTY;
  i = 0;
  j = 0;
  for(k=left;k<right;k++){
    if(L[i]<=R[j]){
      a[k] = L[i];
      i = i+1;
      cnt++;
    }
    else{
      a[k] = R[j];
      j = j+1;
      cnt++;
    }
  }
}
void merge_sort(int *a, int left, int right){
  int mid;

  if(left+1<right){
    mid = (left + right)/2;
    merge_sort(a, left, mid);
    merge_sort(a, mid, right);
    merge(a, left, mid, right);
  }
}

Compiler output:
main.c:5:9: warning: "N" redefined
    5 | #define N 2000000000
      |         ^
main.c:4:9: note: this is the location of the previous definition
    4 | #define N 500000
      |         ^
main.c: In function 'merge':
main.c:44:11: error: 'INFTY' undeclared (first use in this function)
   44 |   L[n1] = INFTY;
      |           ^~~~~
main.c:44:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define MAX_DATA 500000
#define N 2000000000

void merge(int [],int, int, int);
void mergeSort(int [],int, int);
int A[MAX_DATA],count=0;


int main(){
  int i,n;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  mergeSort(A, 0, n);

  for (i = 0; i <n-1; i++){
    printf("%d ", A[i]);
  }
  printf("%d\n%d\n",A[i],count);
  return 0;
}

void merge(int temp[], int left, int mid, int right){
  int n1, n2, i, j, k, L[N], R[N];
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=temp[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=temp[mid+j];
  }
  L[n1]=N;
  R[n2]=N;
  i=0;
  j=0;

  for(k=left;k<right;k++){
    count++;
    if (L[i] < R[j]){
      temp[k]=L[i];
      i=i+1;
    }
    else{
      temp[k]=R[j];
      j=j+1;
    }
  }
}

void mergesort(int temp[],int left,int right){
  int mid;
  if (right > left+1){
    mid = (right + left) / 2;
    mergesort(temp, left, mid);
    mergesort(temp, mid, right);
    merge(temp, left, mid, right);
  }
}

Compiler output:
/usr/bin/ld: /tmp/ccpEp4cN.o: in function `main':
main.c:(.text+0x7b): undefined reference to `mergeSort'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define MAX_DATA 500000
#define N 2000000000

void merge(int[],int, int, int);
void mergeSort(int[],int, int);
int A[MAX_DATA],count=0;


int main(){
  int i,n;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  mergeSort(A,0,n);

  for (i = 0; i <n-1; i++){
    printf("%d ", A[i]);
  }
  printf("%d\n%d\n",A[i],count);
  return 0;
}

void merge(int temp[], int left, int mid, int right){
  int n1, n2, i, j, k, L[N], R[N];
  n1= mid-left;
  n2=right-mid;
  for(i=0;i<n1;i++){
    L[i]=temp[left +i];
  }
  for(j=0;j<n2;j++){
    R[j]=temp[mid+j];
  }
  L[n1]=N;
  R[n2]=N;
  i=0;
  j=0;

  for(k=left;k<right;k++){
    count++;
    if (L[i] < R[j]){
      temp[k]=L[i];
      i=i+1;
    }
    else{
      temp[k]=R[j];
      j=j+1;
    }
  }
}

void mergesort(int temp[],int left,int right){
  int mid;
  if (right > left+1){
    mid = (right + left) / 2;
    mergesort(temp, left, mid);
    mergesort(temp, mid, right);
    merge(temp, left, mid, right);
  }
}

Compiler output:
/usr/bin/ld: /tmp/ccKsHV6O.o: in function `main':
main.c:(.text+0x7b): undefined reference to `mergeSort'
collect2: error: ld returned 1 exit status