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

#include <stdio.h>
#define INF 1e8

int Matrix[100][100];
int size[101];

void matrixChainOrder(int N){
    for ( int ix = 0 ; ix < N ; ix++)
        Matrix[ix][ix] = 0;
        
    for ( int lx = 2 ; lx < N ; lx++)
        for ( int ix = 1 ; ix < N-lx+1 ; ix++){
            int jx = ix+lx-1;
            Matrix[ix][jx] = INF;
            for ( int kx = ix ; kx < jx-1 ; kx++){
                int temp = Matrix[ix][kx] + Matrix[kx+1][jx] + size[ix-1]*size[kx]*size[jx];
                if ( temp < Matrix[ix][jx])
                    Matrix[ix][jx] = temp;
            }
        }
}

int main(){
    int N;
    scanf("%d\n",%N);
    for ( int ix = 0 ; ix < N ; ix++ ){
        scanf("%d %d\n",&size[i],&size[i+1]);
    }
    matrixChainOrder(N);
    printf("%d\n",Matrix[1][N-1]);
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:25:18: error: expected expression before '%' token
   25 |     scanf("%d\n",%N);
      |                  ^
main.c:27:31: error: 'i' undeclared (first use in this function); did you mean 'ix'?
   27 |         scanf("%d %d\n",&size[i],&size[i+1]);
      |                               ^
      |                               ix
main.c:27:31: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#define INF 1e8

int Matrix[100][100];
int size[101];

void matrixChainOrder(int N){
    for ( int ix = 0 ; ix < N ; ix++)
        Matrix[ix][ix] = 0;
        
    for ( int lx = 2 ; lx < N ; lx++)
        for ( int ix = 1 ; ix < N-lx+1 ; ix++){
            int jx = ix+lx-1;
            Matrix[ix][jx] = INF;
            for ( int kx = ix ; kx < jx-1 ; kx++){
                int temp = Matrix[ix][kx] + Matrix[kx+1][jx] + size[ix-1]*size[kx]*size[jx];
                if ( temp < Matrix[ix][jx])
                    Matrix[ix][jx] = temp;
            }
        }
}

int main(){
    int N;
    scanf("%d\n",%N);
    for ( int ix = 0 ; ix < N ; ix++ ){
        scanf("%d %d\n",&size[ix],&size[ix+1]);
    }
    matrixChainOrder(N);
    printf("%d\n",Matrix[1][N-1]);
    
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:25:18: error: expected expression before '%' token
   25 |     scanf("%d\n",%N);
      |                  ^
Language: C

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

#define inf (1<<21)
#define N 100;

int main(){
  int i, j, k, n, c, p[N+1], m[N+1][N+1];
  scanf("%d",&n);
  for(i=1 ; i<=n ; i++)scanf("%d%d",&p[i-1],&p[i]);
  for(i=1 ; i<=n ; i++)m[i][j]=0;
  for(j=2 ; j<=n ; j++){
    for(i=1 ; i<=n-j+1 ; i++){
      c=i+j-1;
      m[i][c]=inf;
      for(k=i ; k<=c-1 ; k++){
        if(m[i][c]>m[i][k]+m[k+1][c]+p[i-1]*p[k]*p[c])m[i][c]=m[i][k]+m[k+1][c]+p[i-1]*p[k]*p[c];
      }
    }
  }
  printf("%d\n",m[1][n]);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:14: error: expected ']' before ';' token
    5 | #define N 100;
      |              ^
main.c:8:24: note: in expansion of macro 'N'
    8 |   int i, j, k, n, c, p[N+1], m[N+1][N+1];
      |                        ^
main.c:8:35: error: expected ';' before ']' token
    8 |   int i, j, k, n, c, p[N+1], m[N+1][N+1];
      |                                   ^
      |                                   ;
main.c:8:35: error: expected statement before ']' token
main.c:8:36: error: expected expression before '[' token
    8 |   int i, j, k, n, c, p[N+1], m[N+1][N+1];
      |                                    ^
main.c:10:38: error: 'p' undeclared (first use in this function)
   10 |   for(i=1 ; i<=n ; i++)scanf("%d%d",&p[i-1],&p[i]);
      |                                      ^
main.c:10:38: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:24: error: 'm' undeclared (first use in this function)
   11 |   for(i=1 ; i<=n ; i++)m[i][j]=0;
      |                        ^
Language: C

#include <stdio.h>
 
#define INF 10000000
 
int main(){
  int n,i,j,k,l,q,r[100],c[100],p[101];
  int mm[101][101];
  
  
  scanf("%d",&n);
  for(i = 0 ; i < n; i++){
    scanf("%d%d",&m[i],&M[i]);
  }

  for(i = 0 ; i < Nn ; i++){
  	for(i=1;i<n-l+2;i++) {
  		j=i+l-1;
    mm[i][j] = 0;
  }
  }
    for(k = i ; k < j-1 ; k++){
t=mm[i][k] + mm[k+1][j] + M[i-1] * M[k] *M[j];

        if(t < mm[i][j]){
          mm[i][j] = t;
        }
      }
    }
  }
  printf("%d\n",mm[1][n]);
  return 0;


Compiler output:
main.c: In function 'main':
main.c:12:19: error: 'm' undeclared (first use in this function); did you mean 'mm'?
   12 |     scanf("%d%d",&m[i],&M[i]);
      |                   ^
      |                   mm
main.c:12:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:25: error: 'M' undeclared (first use in this function)
   12 |     scanf("%d%d",&m[i],&M[i]);
      |                         ^
main.c:15:19: error: 'Nn' undeclared (first use in this function); did you mean 'n'?
   15 |   for(i = 0 ; i < Nn ; i++){
      |                   ^~
      |                   n
main.c:22:1: error: 't' undeclared (first use in this function)
   22 | t=mm[i][k] + mm[k+1][j] + M[i-1] * M[k] *M[j];
      | ^
main.c: At top level:
main.c:29:3: error: expected identifier or '(' before '}' token
   29 |   }
      |   ^
main.c:30:10: error: expected declaration specifiers or '...' before string constant
   30 |   printf("%d\n",mm[1][n]);
      |          ^~~~~~
main.c:30:17: error: unknown type name 'mm'
   30 |   printf("%d\n",mm[1][n]);
      |                 ^~
main.c:31:3: error: expected identifier or '(' before 'return'
   31 |   return 0;
      |   ^~~~~~
Language: C

#include <stdio.h>
 
#define INF 10000000
 
int main(){
  int n,i,j,k,l,q,r[100],c[100],p[101];
  int mm[101][101];
  
  
  scanf("%d",&n);
  for(i = 0 ; i < n; i++){
    scanf("%d%d",&m[i],&M[i]);
  }

  for(i = 0 ; i < Nn ; i++){
  	for(i=1;i<n-l+2;i++) {
  		j=i+l-1;
    mm[i][j] = 0;
  }
  
    for(k = i ; k < j-1 ; k++){
t=mm[i][k] + mm[k+1][j] + M[i-1] * M[k] *M[j];

        if(t < mm[i][j]){
          mm[i][j] = t;
        }
      }
    }
  
  printf("%d\n",mm[1][n]);
  return 0;
  }


Compiler output:
main.c: In function 'main':
main.c:12:19: error: 'm' undeclared (first use in this function); did you mean 'mm'?
   12 |     scanf("%d%d",&m[i],&M[i]);
      |                   ^
      |                   mm
main.c:12:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:25: error: 'M' undeclared (first use in this function)
   12 |     scanf("%d%d",&m[i],&M[i]);
      |                         ^
main.c:15:19: error: 'Nn' undeclared (first use in this function); did you mean 'n'?
   15 |   for(i = 0 ; i < Nn ; i++){
      |                   ^~
      |                   n
main.c:22:1: error: 't' undeclared (first use in this function)
   22 | t=mm[i][k] + mm[k+1][j] + M[i-1] * M[k] *M[j];
      | ^
Language: C

#include<stdio.h>

static const int N = 100;

int main() {
  int n,i,j,k,l,v,A[N+1],B[N+1];

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

  for (i = 1 ; i <= n ; i++) {
    B[i][i] = 0;
  }
  for(l = 2 ; l <= n ; l++) {
    for(i = 0 ; i <= n-l+1 ; i++) {
      j = i + l - 1;
      B[i][j] = (1<<21);
      for(k = i ; k <= j-1 ; k++) {
	B[i][j] = min(B[i][j], B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j]);
	v = B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j];
	printf("B[%d,%d] + B[%d,%d] + A[%d]A[%d]A[%d] = %d\n",i,k,k+1,j,i-1,k,j,v);
      }
    }
  }

  for (i = 1 ; i <= n ; i++) {
    for (j = 1 ; j <= n ; j++) {
      printf("%4d", B[i][j]);
    }
    printf("\n");
  }

  printf("%d\n", B[1][n]);
  
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:14:9: error: subscripted value is neither array nor pointer nor vector
   14 |     B[i][i] = 0;
      |         ^
main.c:19:11: error: subscripted value is neither array nor pointer nor vector
   19 |       B[i][j] = (1<<21);
      |           ^
main.c:21:13: error: subscripted value is neither array nor pointer nor vector
   21 |         B[i][j] = min(B[i][j], B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j]);
      |             ^
main.c:21:19: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   21 |         B[i][j] = min(B[i][j], B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j]);
      |                   ^~~
      |                   main
main.c:21:27: error: subscripted value is neither array nor pointer nor vector
   21 |         B[i][j] = min(B[i][j], B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j]);
      |                           ^
main.c:21:36: error: subscripted value is neither array nor pointer nor vector
   21 |         B[i][j] = min(B[i][j], B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j]);
      |                                    ^
main.c:21:48: error: subscripted value is neither array nor pointer nor vector
   21 |         B[i][j] = min(B[i][j], B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j]);
      |                                                ^
main.c:22:17: error: subscripted value is neither array nor pointer nor vector
   22 |         v = B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j];
      |                 ^
main.c:22:29: error: subscripted value is neither array nor pointer nor vector
   22 |         v = B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j];
      |                             ^
main.c:30:25: error: subscripted value is neither array nor pointer nor vector
   30 |       printf("%4d", B[i][j]);
      |                         ^
main.c:35:22: error: subscripted value is neither array nor pointer nor vector
   35 |   printf("%d\n", B[1][n]);
      |                      ^
Language: C

#include<stdio.h>

static const int N = 100;

int main() {
  int i,j,k,l,n,v,A[N+1],B[N+1][N+1];

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

  for (i = 1 ; i <= n ; i++) {
    B[i][i] = 0;
  }
  for(l = 2 ; l <= n ; l++) {
    for(i = 0 ; i <= n-l+1 ; i++) {
      j = i + l - 1;
      B[i][j] = (1<<21);
      for(k = i ; k <= j-1 ; k++) {
	B[i][j] = min(B[i][j], B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j]);
	v = B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j];
	printf("B[%d,%d] + B[%d,%d] + A[%d]A[%d]A[%d] = %d\n",i,k,k+1,j,i-1,k,j,v);
      }
    }
  }

  for (i = 1 ; i <= n ; i++) {
    for (j = 1 ; j <= n ; j++) {
      printf("%4d", B[i][j]);
    }
    printf("\n");
  }

  printf("%d\n", B[1][n]);
  
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:21:19: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   21 |         B[i][j] = min(B[i][j], B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j]);
      |                   ^~~
      |                   main
Language: C

#include<stdio.h>
#include<limits.h>
int main() {
    int size, temp,j, q;
    int p[size+1];
    int m[szie+1][size+1];

    scanf("%d", &size);
    for (int i = 0; i < size; i++) {
        scanf("%d %d", &p[i], &temp);
    }
    p[size] = temp;
    
    for (int i = 1; i < size + 1; i++)
    {
        m[i][i] = 0;
    }

    for (int l = 2; l < size + 1; l++) 
    {
        for (int i = 1; i < size - l + 2; i++) 
        {
            j = i + l - 1;
            m[i][j] = INT_MAX;
            for (int k = i; k <= j - 1; k++) 
            {
                q = (m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j]);
                if (m[i][j] > q) 
                {
                    m[i][j] = q;
                }
            }
        }
    }
    printf("%d\n", m[1][size]);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:6:11: error: 'szie' undeclared (first use in this function); did you mean 'size'?
    6 |     int m[szie+1][size+1];
      |           ^~~~
      |           size
main.c:6:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<limits.h>

int p[300];
int m[101][101];
 
void matrixChainOrder(int n){
int l,i,j,k,q;
 
for(i=1;i<=n;i++)m[i][i]=0;
 
for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
        j=i+l-1;
        m[i][j]=INT_MAX;
        for(k=i;k<=j-1;k++){
            q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
            if(m[i][j]>q)m[i][j]=q;
        }
    }
}
 
int main(){
    int n,i;
    int a,b;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d%d",&a,&b);
        if(i!=n-1)p[i]=a;
        else {
      p[i]=a;
      p[i+1]=b;
    }
  }
 
  matrixChainOrder(n);
 
  printf("%d\n",m[1][n]);
  return 0;
}


Compiler output:
main.c: In function 'matrixChainOrder':
main.c:40:1: error: expected declaration or statement at end of input
   40 | }
      | ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#define N 100
#define INF 1000000000
 
int MatrixChain(int *, int);
int min(int, int);
 
int main() {
  int i, j, n;
  int r[N], c[N];
  int min;
 
  // input
  scanf("%d", &n);
  for(i = 0; i < n; i++) {
    if(i == 0)scanf("%d %d", &r[i], &r[i+1]);
    else scanf("%d %d", &c[i], &r[i+1]);
  }
 
  // MATRIX-CHAIN MULTIPLICATION PROBLEM
  printf("%d\n", MatrixChain(r, n));
 
  return 0;
}
 
int MatrixChain(int *r, int n) {
  int i, j, k, l;
  int m[N][N];
  int len;
  int q;
 
  len = n;
  for(i = 1; i <= len; i++) {
    m[i][i] = 0;
  }
 
  for(l = 2; l <= len; l++) {
    for(i = 1; i <= len-l+1; i++) {
      j = i + l - 1;
      m[i][j] = INF;
      for(k = i; k <= j-1; k++) {
    q = m[i][k] + m[k+1][j] + r[i-1] * r[k] * r[j];
    m[i][j] = min(m[i][j], q);
      }
    }
  }
 
  return m[1][len];
}
 
int min(int x, int y) {
  if(x > y) return y;
  else return x;
}#include <stdio.h>
#include <stdlib.h>
#define N 100
#define INF 1000000000
 
int MatrixChain(int *, int);
int min(int, int);
 
int main() {
  int i, j, n;
  int r[N], c[N];
  int min;
 
  // input
  scanf("%d", &n);
  for(i = 0; i < n; i++) {
    if(i == 0)scanf("%d %d", &r[i], &r[i+1]);
    else scanf("%d %d", &c[i], &r[i+1]);
  }
 
  // MATRIX-CHAIN MULTIPLICATION PROBLEM
  printf("%d\n", MatrixChain(r, n));
 
  return 0;
}
 
int MatrixChain(int *r, int n) {
  int i, j, k, l;
  int m[N][N];
  int len;
  int q;
 
  len = n;
  for(i = 1; i <= len; i++) {
    m[i][i] = 0;
  }
 
  for(l = 2; l <= len; l++) {
    for(i = 1; i <= len-l+1; i++) {
      j = i + l - 1;
      m[i][j] = INF;
      for(k = i; k <= j-1; k++) {
    q = m[i][k] + m[k+1][j] + r[i-1] * r[k] * r[j];
    m[i][j] = min(m[i][j], q);
      }
    }
  }
 
  return m[1][len];
}
 
int min(int x, int y) {
  if(x > y) return y;
  else return x;
}


Compiler output:
main.c:55:2: error: stray '#' in program
   55 | }#include <stdio.h>
      |  ^
main.c:55:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   55 | }#include <stdio.h>
      |           ^
main.c:63:5: error: redefinition of 'main'
   63 | int main() {
      |     ^~~~
main.c:9:5: note: previous definition of 'main' with type 'int()'
    9 | int main() {
      |     ^~~~
main.c:81:5: error: redefinition of 'MatrixChain'
   81 | int MatrixChain(int *r, int n) {
      |     ^~~~~~~~~~~
main.c:27:5: note: previous definition of 'MatrixChain' with type 'int(int *, int)'
   27 | int MatrixChain(int *r, int n) {
      |     ^~~~~~~~~~~
main.c:106:5: error: redefinition of 'min'
  106 | int min(int x, int y) {
      |     ^~~
main.c:52:5: note: previous definition of 'min' with type 'int(int,  int)'
   52 | int min(int x, int y) {
      |     ^~~
Language: C

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

 
void Matrix(int *p,int plength){
  int i,j,k,l,q;
  int n=plength-1;
  int m[plength][plength];
 

}
 
main(){
  int i,j,k,l,,q,n,huyou,len;
  int A[201],n[201][201];
 
  scanf("%d",&n);
 
  for(i=0;i<=n;i++){
	scanf("%d%d",&A[i],&huyou);
  }
  scanf("%d%d",&A[i],&A[i+1]);

  for(i=0;i<=n;i++) m[i][i]=0;
   
  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
      j=i+l-1;
      m[i][j]=INT_MAX;
      for(k=i;k<=j-1;k++){
    q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
    m[i][j]=(m[i][j]<q ? m[i][j]:q);
      }
    }
  }
  printf("%d\n",m[i][j]);
 
  return 0;
}

Compiler output:
main.c:14:1: error: return type defaults to 'int' [-Wimplicit-int]
   14 | main(){
      | ^~~~
main.c: In function 'main':
main.c:15:15: error: expected identifier or '(' before ',' token
   15 |   int i,j,k,l,,q,n,huyou,len;
      |               ^
main.c:20:12: warning: comparison between pointer and integer
   20 |   for(i=0;i<=n;i++){
      |            ^~
main.c:21:29: error: 'huyou' undeclared (first use in this function)
   21 |         scanf("%d%d",&A[i],&huyou);
      |                             ^~~~~
main.c:21:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:25:12: warning: comparison between pointer and integer
   25 |   for(i=0;i<=n;i++) m[i][i]=0;
      |            ^~
main.c:25:21: error: 'm' undeclared (first use in this function)
   25 |   for(i=0;i<=n;i++) m[i][i]=0;
      |                     ^
main.c:27:12: warning: comparison between pointer and integer
   27 |   for(l=2;l<=n;l++){
      |            ^~
main.c:28:14: warning: comparison between pointer and integer
   28 |     for(i=1;i<=n-l+1;i++){
      |              ^~
main.c:32:5: error: 'q' undeclared (first use in this function)
   32 |     q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
      |     ^
main.c:32:25: error: 'p' undeclared (first use in this function)
   32 |     q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
      |                         ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
 
main(){
  int i,j,k,l,,q,n,huyou,len;
  int A[201],n[201][201];
 
  scanf("%d",&n);
 
  for(i=0;i<=n;i++){
	scanf("%d%d",&A[i],&huyou);
  }
  scanf("%d%d",&A[i],&A[i+1]);

  for(i=0;i<=n;i++) m[i][i]=0;
   
  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
      j=i+l-1;
      m[i][j]=INT_MAX;
      for(k=i;k<=j-1;k++){
    q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
    m[i][j]=(m[i][j]<q ? m[i][j]:q);
      }
    }
  }
  printf("%d\n",m[i][j]);
 
  return 0;
}

Compiler output:
main.c:5:1: error: return type defaults to 'int' [-Wimplicit-int]
    5 | main(){
      | ^~~~
main.c: In function 'main':
main.c:6:15: error: expected identifier or '(' before ',' token
    6 |   int i,j,k,l,,q,n,huyou,len;
      |               ^
main.c:11:12: warning: comparison between pointer and integer
   11 |   for(i=0;i<=n;i++){
      |            ^~
main.c:12:29: error: 'huyou' undeclared (first use in this function)
   12 |         scanf("%d%d",&A[i],&huyou);
      |                             ^~~~~
main.c:12:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:12: warning: comparison between pointer and integer
   16 |   for(i=0;i<=n;i++) m[i][i]=0;
      |            ^~
main.c:16:21: error: 'm' undeclared (first use in this function)
   16 |   for(i=0;i<=n;i++) m[i][i]=0;
      |                     ^
main.c:18:12: warning: comparison between pointer and integer
   18 |   for(l=2;l<=n;l++){
      |            ^~
main.c:19:14: warning: comparison between pointer and integer
   19 |     for(i=1;i<=n-l+1;i++){
      |              ^~
main.c:23:5: error: 'q' undeclared (first use in this function)
   23 |     q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
      |     ^
main.c:23:25: error: 'p' undeclared (first use in this function)
   23 |     q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
      |                         ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
#define N 203
 
main(){
  int i,j,k,l,,q,n,huyou,len;
  int A[N],n[N][N];
 
  scanf("%d",&n);
 
  for(i=1;i<n;i++){
	scanf("%d%d",&A[i],&huyou);
  }
  scanf("%d%d",&A[i],&A[i+1]);

  for(i=1;i<=n;i++){
	m[i][i]=0;
  }

  for(l=2;l<=n+1;l++){
    for(i=1;i<=n-l+2;i++){
      j=i+l-1;
      m[i][j]=INT_MAX;
      for(k=i;k<=j-1;k++){
    q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
    m[i][j]=(m[i][j]<q ? m[i][j]:q);
      }
    }
  }
  printf("%d\n",m[i][j]);
 
  return 0;
}

Compiler output:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main(){
      | ^~~~
main.c: In function 'main':
main.c:7:15: error: expected identifier or '(' before ',' token
    7 |   int i,j,k,l,,q,n,huyou,len;
      |               ^
main.c:12:12: warning: comparison between pointer and integer
   12 |   for(i=1;i<n;i++){
      |            ^
main.c:13:29: error: 'huyou' undeclared (first use in this function)
   13 |         scanf("%d%d",&A[i],&huyou);
      |                             ^~~~~
main.c:13:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:12: warning: comparison between pointer and integer
   17 |   for(i=1;i<=n;i++){
      |            ^~
main.c:18:9: error: 'm' undeclared (first use in this function)
   18 |         m[i][i]=0;
      |         ^
main.c:21:12: warning: comparison between pointer and integer
   21 |   for(l=2;l<=n+1;l++){
      |            ^~
main.c:22:14: warning: comparison between pointer and integer
   22 |     for(i=1;i<=n-l+2;i++){
      |              ^~
main.c:26:5: error: 'q' undeclared (first use in this function)
   26 |     q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
      |     ^
main.c:26:25: error: 'p' undeclared (first use in this function)
   26 |     q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
      |                         ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
#define N 203
 
main(){
  int i,j,k,l,,q,n,huyou,len;
  int A[N],m[N][N];
 
  scanf("%d",&n);
 
  for(i=1;i<n;i++){
	scanf("%d%d",&A[i],&huyou);
  }
  scanf("%d%d",&A[i],&A[i+1]);

  for(i=1;i<=n;i++){
	m[i][i]=0;
  }

  for(l=2;l<=n+1;l++){
    for(i=1;i<=n-l+2;i++){
      j=i+l-1;
      m[i][j]=INT_MAX;
      for(k=i;k<=j-1;k++){
    q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
    m[i][j]=(m[i][j]<q ? m[i][j]:q);
      }
    }
  }
  printf("%d\n",m[i][j]);
 
  return 0;
}

Compiler output:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main(){
      | ^~~~
main.c: In function 'main':
main.c:7:15: error: expected identifier or '(' before ',' token
    7 |   int i,j,k,l,,q,n,huyou,len;
      |               ^
main.c:10:15: error: 'n' undeclared (first use in this function)
   10 |   scanf("%d",&n);
      |               ^
main.c:10:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:29: error: 'huyou' undeclared (first use in this function)
   13 |         scanf("%d%d",&A[i],&huyou);
      |                             ^~~~~
main.c:26:5: error: 'q' undeclared (first use in this function)
   26 |     q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
      |     ^
main.c:26:25: error: 'p' undeclared (first use in this function)
   26 |     q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
      |                         ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#define N 150
 
int mco,m[N][N],w;
 
 
 
void MCO(int* p){
  int n,i,j,k,q,l;
  n=w;
  for(l=1;l<n;l++){
    for(i=0;i<n-l+1;i++){
      j=i+l-1;
      m[i][j]=-1;
      for(k=i;k<j-1;k++){
    q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
    if(m[i][j]<0||m[i][j]>q)m[i][j]=q;
      }
 
    }
 
 
 
  }
 
 printf(“%d",m[i][j]);
 
}
 
int main(){
  int i,j,n,A[N],B[N];
  scanf("%d",&n);
  w=n;
  for(i=0;i<n;i++){
    scanf("%d %d",&A[i],&B[i]);
  }
  A[n]=B[n-1];
  
  MCO(A);
 
 
 
  return 0;
}

Compiler output:
main.c: In function 'MCO':
main.c:27:9: error: stray '\342' in program
   27 |  printf(<U+201C>%d",m[i][j]);
      |         ^~~~~~~~
main.c:27:10: error: expected expression before '%' token
   27 |  printf(“%d",m[i][j]);
      |          ^
main.c:27:12: warning: missing terminating " character
   27 |  printf(“%d",m[i][j]);
      |            ^
main.c:27:12: error: missing terminating " character
   27 |  printf(“%d",m[i][j]);
      |            ^~~~~~~~~~~
main.c:27:12: error: expected ';' before '}' token
   27 |  printf(“%d",m[i][j]);
      |            ^
      |            ;
   28 | 
   29 | }
      | ~
Language: C

#include<stdio.h>
#include<stdlib.h>
#define N 150
 
int mco,m[N][N],w;
 
 
 
void MCO(int* p){
  int n,i,j,k,q,l;
  n=w;
  for(l=1;l<n;l++){
    for(i=0;i<n-l+1;i++){
      j=i+l-1;
      m[i][j]=1000000;
      for(k=i;k<j-1;k++){
    q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
    if(m[i][j]>q)m[i][j]=q;
      }
 
    }
 
 
 
  }
 
 printf("%d\n",m[i][j]);
 
}
 
int main(){
  int i,j,n,A[N],B[N];
  scanf(“%d\n",&n);
  w=n;
  for(i=0;i<n;i++){
    scanf("%d %d",&A[i],&B[i]);
  }
  A[n]=B[n-1];
  
  MCO(A);
 
 
 
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:33:9: error: stray '\342' in program
   33 |   scanf(<U+201C>%d\n",&n);
      |         ^~~~~~~~
main.c:33:10: error: expected expression before '%' token
   33 |   scanf(“%d\n",&n);
      |          ^
main.c:33:12: error: stray '\' in program
   33 |   scanf(“%d\n",&n);
      |            ^
main.c:33:14: warning: missing terminating " character
   33 |   scanf(“%d\n",&n);
      |              ^
main.c:33:14: error: missing terminating " character
   33 |   scanf(“%d\n",&n);
      |              ^~~~~~
main.c:44:12: error: expected ';' before '}' token
   44 |   return 0;
      |            ^
      |            ;
   45 | }
      | ~
Language: C

#include<stdio.h>
#include<limits.h>
#define N 150
  
int m[N][N];
  
  
  
void MCO(int* p,int x){
  int i,j,k,q,l,n;
n=x-1;
  for(l=2;l=<n;l++){
    for(i=1;i=<n-l+1;i++){
      j=i+l-1;
      m[i][j]=INT_MAX;
      for(k=i;k<=j-1;k++){
    q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
    if(m[i][j]>q)m[i][j]=q;
      }
  
    }
  
  
  
  }
  
 printf("%d\n",m[i][j]);
  
}
  
int main(){
  int i,j,n,A[N],B[N];
  scanf("%d",&n);
  w=n;
  for(i=1;i=<n;i++){
    scanf("%d %d",&A[i],&B[i]);
  }
  A[n+1]=B[n];
   
  MCO(A);
  
  
  
  return 0;
}

Compiler output:
main.c: In function 'MCO':
main.c:12:13: error: expected expression before '<' token
   12 |   for(l=2;l=<n;l++){
      |             ^
main.c:13:15: error: expected expression before '<' token
   13 |     for(i=1;i=<n-l+1;i++){
      |               ^
main.c: In function 'main':
main.c:34:3: error: 'w' undeclared (first use in this function)
   34 |   w=n;
      |   ^
main.c:34:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:35:13: error: expected expression before '<' token
   35 |   for(i=1;i=<n;i++){
      |             ^
main.c:40:3: error: too few arguments to function 'MCO'
   40 |   MCO(A);
      |   ^~~
main.c:9:6: note: declared here
    9 | void MCO(int* p,int x){
      |      ^~~
Language: C

#include<stdio.h>
#include<limits.h>
#define N 150
  
int m[N][N];
  
  
  
void MCO(int* p,int x){
  int i,j,k,q,l,n;
n=x-1;
  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
      j=i+l-1;
      m[i][j]=INT_MAX;
      for(k=i;k<=j-1;k++){
    q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
    if(m[i][j]>q)m[i][j]=q;
      }
  
    }
  
  
  
  }
  
 printf("%d\n",m[i][j]);
  
}
  
int main(){
  int i,j,n,A[N],B[N];
  scanf("%d",&n);

  for(i=1;i=<n;i++){
    scanf("%d %d",&A[i],&B[i]);
  }
  A[n+1]=B[n];
   
  MCO(A,x+2);
  
  
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:13: error: expected expression before '<' token
   35 |   for(i=1;i=<n;i++){
      |             ^
main.c:40:9: error: 'x' undeclared (first use in this function)
   40 |   MCO(A,x+2);
      |         ^
main.c:40:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define MUGEN 20000000

void MatrixChainOrder(int[]);
int row[100];
int column[100];
int p[101];

int main(){
  
  int number,i;
  

  scanf("%d",&number);
  for(i=1;i<=number;i++){
    scanf("%d %d",&row[i],&column[i]);
  }
  for(i=1;i<=number;i++){
    p[i]=row[i];
  }  
  p[i+1]=column[i];

  MatrixChainOrder(p);

  return 0;
}

void MatrixChainOrder(int[] p){
  
  int a,i,j,l,k,q;
  
  a=sizeof(array(p))-1;
  int m[a+1][a+1]; //both--> dont use index '0'
  int s[a][a+1]; //left-->dont use index '0',right--> dont use index '0 and 1'
  
  for(i=1;i<=a;i++){
    m[i][i]=0;
  }
  for(l=2;l<=a;l++){
    for(i=1;i<=a-l+1;i++){
      j=i+l-1;
      m[i][j]=MUGEN;
      for(k=i;k<j-1;j++){
	q=m[i][k] + m[k+1][j] + p[i-1]*p[k]*p[j];
	if(q<m[i][j]){
	  m[i][j]=q;
	  s[i][j]=k;
	}
	
      }
    }
  }
  
}

Compiler output:
main.c:28:29: error: expected ';', ',' or ')' before 'p'
   28 | void MatrixChainOrder(int[] p){
      |                             ^
Language: C

#include <stdio.h>
#include <limits.h>
#define N 100
int p[N];
int n;
int m[N][N];
void MatrixChainOrder(void){
	int i, j, k, l, m, q;
	for(i=1; i<=n; i++ ) m[i][i]=0;
	for(l=2; l<=n; l++){
		for(i=1; i<=n-l-1; i++){
			j=i+l-1;
			m[i][j]=INT_MAX;
			for(k=i; k<=j-1; k++){
				q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
				if(m[i][j]>q) m[i][j]=q;
			}
		}
	}
}
int main(void){
	int i;
	int r, c;
	scanf("%d", &n);
	for( i=0; i<n; i++ ){
		scanf("%d %d",&r, &c);
		p[i]=r;
		p[i+1]=c;
	}
	MatrixChainOrder();
	printf("%d\n", m[1][n]);
	return 0;
}

Compiler output:
main.c: In function 'MatrixChainOrder':
main.c:9:31: error: subscripted value is neither array nor pointer nor vector
    9 |         for(i=1; i<=n; i++ ) m[i][i]=0;
      |                               ^
main.c:13:26: error: subscripted value is neither array nor pointer nor vector
   13 |                         m[i][j]=INT_MAX;
      |                          ^
main.c:15:36: error: subscripted value is neither array nor pointer nor vector
   15 |                                 q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
      |                                    ^
main.c:15:44: error: subscripted value is neither array nor pointer nor vector
   15 |                                 q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
      |                                            ^
main.c:16:37: error: subscripted value is neither array nor pointer nor vector
   16 |                                 if(m[i][j]>q) m[i][j]=q;
      |                                     ^
main.c:16:48: error: subscripted value is neither array nor pointer nor vector
   16 |                                 if(m[i][j]>q) m[i][j]=q;
      |                                                ^
Language: C

#include<stdio.h>

int M[100][100];
int p[101];
 
void m(int);
 
int main(){

  int i, n;

  scanf("%d", &n);

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

  m(n);

  printf("%d\n", M[1][n]);

  return 0;

}

void m(int n){

  int i,j,b,a,q;

  for(i = 1 ; i < n + 1 ; i++){
    M[i][i] = 0;
  }

  for(a = 2 ; a < n + 1 ; a++){

    for(i = 1 ; i < n - a + 2 ; i++){

      j = i + a - 1;

      M[i][j] = 1000000000;

      for(b = i ; b < j ; b++){
	q = M[i][b] + M[b + 1][j] + p[i - 1] * p[b] * p[j];
	if(M[i][j] <= q) M[i][j] = M[i][j];
	else M[i][j] = q;
      }

    }

  }
/
}

Compiler output:
main.c: In function 'm':
main.c:51:1: error: expected expression before '/' token
   51 | /
      | ^
Language: C

#include <stdio.h>

#define N 100
#define INF 1000000

void Matrix_Chain_Order(int *);
int Mini(int , int );

int r[N], c[N], p[N], mat[N][N], n;

int main() {
  
  int i,j; 
  
  scanf("%d", &n);
  if(n < 0 || N < n){
    return 0;
  }
  
  for(i = 0; i < n; i++){
    scanf("%d %d", &r[i], &c[i]);
  }
  
  for(i = 0; i < n; i++){
    if(i == 0) {
      p[i] = r[i];
      p[i+1] = c[i];
    }
    else p[i+1] = c[i];
  }
  
  Matrix_Chain_Order(p);
  
  printf("%d\n", m[1][n]);
  
  return 0;
}


void Matrix_Chain_Order(int *p){
  int i,j,k;
  int l,q=0;
  
  for(i=1;i <= n;i++){
    m[i][i] = 0;
  }
  
  for(l = 2; l <= n; l++){
    for(i = 1; i <= n-l+1; i++){

      j = i+l-1;
      mat[i][j] = INF;

      for(k = i+1; k <= j; k++){
	q = mat[i][k-1]+mat[k][j]+(p[i-1]*p[k-1]*p[j]);
	if(q < mat[i][j]){
	  mat[i][j] = q;
	}
      }

    }
  }
}

Compiler output:
main.c: In function 'main':
main.c:34:18: error: 'm' undeclared (first use in this function)
   34 |   printf("%d\n", m[1][n]);
      |                  ^
main.c:34:18: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'Matrix_Chain_Order':
main.c:45:5: error: 'm' undeclared (first use in this function)
   45 |     m[i][i] = 0;
      |     ^
Language: C

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

int Chain(int);
int min(int, int, int);

int sec[101];
int m[101][101];

main(){
  int n;

  int min;

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

    sec[i] = m[i+1][0];
 
  }
  sec[n] = m[n][1];
  i = Chain(n);
  printf("%d\n",m[1][i]);
 
 return 0;

}

int Chain(int n){
  
  int i, l, j, k, q;
  
  for(i = 1; i <= n; i++){
    
    m[i][i] = 0;
  
  }
 
  for(j = 2; j <= n; j++){
    for(i = 1; i <= n - j + 1; i++){
      
      l = i + j - 1;
      
      m[i][l] = INT_MAX;
      
      for(k = i; k <= l-1; k++){
	
	q = m[i][k] + m[k+1][l] + sec[i-1]*sec[k]*sec[l];
	 
	m[i][l] = min(i, l, q);

      }
    }
  }
  return l;
}

int min(int i, int j, int min){

  if(m[i][j] > min)
    return min;

  return m[i][j];
}

Compiler output:
main.c:11:1: error: return type defaults to 'int' [-Wimplicit-int]
   11 | main(){
      | ^~~~
main.c: In function 'main':
main.c:18:7: error: 'i' undeclared (first use in this function)
   18 |   for(i = 1; i <= n; i++){
      |       ^
main.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

int x;
int P[N];
int M[N][N];
void Matrix_Chain_Order(){
  int n,i,j,l,k,q;
  n=x;
 
  for(i=1;i<=n;i++){
    M[i][i]=0;
  }
  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
      j=i+l-1;
      M[i][j]=100000;
      for(k=i;k<=j-1;k++){
    q=M[i][k]+M[k+1][j]+P[i]*P[k+1]*P[j+1];
    if(q<M[i][j]){
      M[i][j]=q;
    }
      }
    }
  }
  printf("%d\n", M[1][x]);
}
 
main(){
   
  int n,i,a,count;
  scanf("%d",&x);
   
  for(i=0;i<x;i++){
    scanf("%d %d",&P[i+1],&a);
     
  }
  P[i+1]=a;
   
  Matrix_Chain_Order();
   
  return 0;
}

Compiler output:
main.c:2:7: error: 'N' undeclared here (not in a function)
    2 | int P[N];
      |       ^
main.c: In function 'Matrix_Chain_Order':
main.c:23:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   23 |   printf("%d\n", M[1][x]);
      |   ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | int x;
main.c:23:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   23 |   printf("%d\n", M[1][x]);
      |   ^~~~~~
main.c:23:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: At top level:
main.c:26:1: error: return type defaults to 'int' [-Wimplicit-int]
   26 | main(){
      | ^~~~
main.c: In function 'main':
main.c:29:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   29 |   scanf("%d",&x);
      |   ^~~~~
main.c:29:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:29:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
main.c:29:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 1000

int getLCS(char*,char*);
int Z[N][N];

main(){
  char X[N],Y[N];
  int q,i;
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%s%s",X,Y);
    printf("%d\n", getLCS(X,Y));
  }
  return 0;
}

int getLCS(char *x,char *y){
  int i,j,a,b;
  a = strlen(x);
  b = strlen(y);

  for(i=0;i<a;i++){
    for(j=0;j<b;j++){
      if(x[i]==y[j])  Z[i+1][j+1] = Z[i][j]+1;
      else Z[i+1][j+1] = ((Z[i][j+1] > Z[i+1][j]) ? Z[i][j+1]:Z[i+1][j]);
    }
  }
  return Z[a][b];

Compiler output:
main.c:9:1: error: return type defaults to 'int' [-Wimplicit-int]
    9 | main(){
      | ^~~~
main.c: In function 'getLCS':
main.c:31:3: error: expected declaration or statement at end of input
   31 |   return Z[a][b];
      |   ^~~~~~
Language: C

#include<stdio.h>
 
#define N 10000
 
int n;
int M[N];
 
int MatrixChainOrder(void);
int Min(int , int );


int MatrixChainOrder(){
 
  int i, j, k, l, q;
  int R[n+1][n+1];
 
  for(i = 1;i <= n;i++){
    R[i][i] = 0;
  }
 
  for(l = 2;l <= n;l++){
    for(i = 1;i <= n - l + 1;i++){
 
      j = i + l - 1;
      R[i][j] = 67148;
 
      for(k = i;k <= j - 1;k++){
 
	q = Res[i][k] + Res[k+1][j] + M[i-1] * M[k] * M[j];
 
	Res[i][j] = Min(Res[i][j], q);
      }
    }
  }
 
  return Res[1][n];
 
}
 

int Min(int x, int y){
 
  if(x > y){
    return y;
  }
 
  else{
    return x;
  }
 
}
 

main(){
 
  int i, j;
 
  scanf("%d",&n);
 
  for(i = 0;i < n;i++){
    scanf("%d%d",&M[2 * i],&M[2 * i + 1]);
  }
 
  for(i = 1;i < 2 * n;i++){
    if(M[i] == M[i + 1]) {
      for(j = i + 1;j < 2 * n;j++){
	M[j] = M[j + 1];
      }
    }
  }
   
  printf("%d\n",MatrixChainOrder());
 
  return 0;
 
}
   
 

Compiler output:
main.c: In function 'MatrixChainOrder':
main.c:29:13: error: 'Res' undeclared (first use in this function)
   29 |         q = Res[i][k] + Res[k+1][j] + M[i-1] * M[k] * M[j];
      |             ^~~
main.c:29:13: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:54:1: error: return type defaults to 'int' [-Wimplicit-int]
   54 | main(){
      | ^~~~
Language: C

#include <cstdio>
#include <cstring>
#include <climits>
#include <algorithm>

using namespace std;

int r[100], c[100];
int dp[100][100];

int optMat(int left, int right)
{
	if (dp[left][right] >= 0){
		return (dp[left][right]);
	}
	if (left == right){
		return (0);
	}
	
	int res = INT_MAX;
	for (int i = left; i < right; i++){
		res = min(res, optMat(left, i) + optMat(i + 1, right) + r[left] * c[i] * c[right]);
	}
	
	return (dp[left][right] = res);
}

int main()
{
	int N;
	
	scanf("%d", &N);
	
	for (int i = 0; i < N; i++){
		scanf("%d %d", &r[i], &c[i]);
	}
	
	memset(dp, -1, sizeof(dp));
	
	printf("%d\n", optMat(0, N - 1));
	
	return (0);
}

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int matrixChainOrder();
int min(int ,int); 

int m[100][100],n;
int p[110][2];

int main()
{
  int i,j;

  scanf("%d",&n); // 行数の数
  for(i = 0;i < n;i++){
    for(j = 0;j < 2;j++){
      scanf("%d",&p[i][j]);
    }
  }

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

  return 0;
}

int matrixChainOrder()
{
  int i,j,l,k,q;

  n = n - 1;

  for(i = 1;i <= n;i++){
    m[i][i] = 0;
  }

  for(l = 2;l <= n;l++){
    for(i = 1;i <= n-l+1;i++){
      j = i+l-1;
      m[i][j] = 2147483647;
      for(k = i;k <= j -1;k++){
	q = m[i][k] + m[k+1][j] + (p[i - 1] * p[k] * p[j]);
	m[i][j] = min(m[i][j], q);
      }
    }
  }
  return m[i][j];
}

int min(int m, int q)
{
  if(m < q) return m;
  else return q;
}

Compiler output:
main.c: In function 'matrixChainOrder':
main.c:40:45: error: invalid operands to binary * (have 'int *' and 'int *')
   40 |         q = m[i][k] + m[k+1][j] + (p[i - 1] * p[k] * p[j]);
      |                                    ~        ^
      |                                    |        |
      |                                    int *    int *
Language: C

#include <stdio.h>
#include <stdlib.h>
#define N 1000000
  
int matrixChainOrder(int *p, int n){
  int i, j, k, l,  a[100][100], q;
  for(i = 1; i <= n; i++) a[i][i] = 0;
  	for(l = 2; l <= n; l++){
    	for(i = 1; i <= n-l+1; i++){
     		j = i + l - 1;
     		a[i][j] = N;
      		for( k = i ; k < j ; k++ ){
    		q = a[i][k] + a[k+1][j] + p[i-1]*p[k]*p[j];
    		if( a[i][j] > q ) a[i][j] = q;
      	}
    }
  }
  return a[i-1][j];
}
  
int main(){
  int i, n, *p;
  scanf("%d",&n);
  p = (int*)malloc(n+1);
  for( i = 0 ; i < n ; i++ ) scanf("%d %d",&p[i], &p[i+1]);
  printf("%d\n",matrixChainOrder(p,n));
  free(q);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:8: error: 'q' undeclared (first use in this function)
   27 |   free(q);
      |        ^
main.c:27:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C

include <stdio.h>
#define MAX 101

int matrixChainMultiplication(int, int *);
int min(int, int);

int main() {
  int n,p[MAX],i;
  scanf("%d",&n);
  for(i = 0; i < n; i++) {
    scanf(" %d %d",&p[i],&p[i+1]);
  }
  printf("%d\n",matrixChainMultiplication(n,p));
  return 0;
}

int matrixChainMultiplication(int n, int *p) {
  int m[MAX][MAX],i,j,k,l;
  for(i = 1; i <= n; i++) {
    m[i][i] = 0;
  }
  for(i = 2; i <= n; i++) {
    for(j = 1; j <= n - i + 1; j++) {
      k = j + i -1;
      m[j][k] = 1000000;
      for(l = j; l <= k - 1; l++) {
	m[j][k] = min(m[j][k],m[j][l] + m[l + 1][k] + p[j - 1] * p[l] * p[k]);
      }
    }
  }
  return m[1][n];
}

int min(int a, int b) {
  if(a < b) return a;
  else return b;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    9 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:9:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    9 |   scanf("%d",&n);
      |   ^~~~~
main.c:9:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:13:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 |   printf("%d\n",matrixChainMultiplication(n,p));
      |   ^~~~~~
main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:17: error: implicit declaration of function 'matrixChainMultiplication' [-Wimplicit-function-declaration]
   13 |   printf("%d\n",matrixChainMultiplication(n,p));
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#define N 100
#define INF 10000000
int M[N][N];

int matrixChainOrder(int*,int);

int main(){

  int i,j,n;
  int p[N];

  scanf("%d",&n);

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

  printf("%d\n",matrixChainOrder(p,n));

  return 0;
}

int matrixChainOrder(int *p,int length){

  int n,i,j,k,q;
  int l;

  for(i=1; i<=n; i++){
    M[i][i] = 0;
  }

  for(l=2; l<=n; l++){
    for(i=1; i<n-l+1; i++){
      j = i+l-1;
      M[i][j] = INF;
      for(k=i; k<j-1; k++){
	q = M[i][k] + M[k+1][j] + p[i-1]*p[k]*p[j];
	if(M[i][j] > q) m[i][j] = q;
      }
    }
  }
  return M[i-1][j];
}

Compiler output:
main.c: In function 'matrixChainOrder':
main.c:40:25: error: 'm' undeclared (first use in this function)
   40 |         if(M[i][j] > q) m[i][j] = q;
      |                         ^
main.c:40:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>
#define N 100
#define INF 10000000
int M[N][N];

int matrixChainOrder(int*,int);

int main(){

  int i,j,n;
  int p[N];

  scanf("%d",&n);

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

  printf("%d\n",matrixChainOrder(p,n));

  return 0;
}

int matrixChainOrder(int *p,int length){

  int n,i,j,k,q;
  int l;

  for(i=1; i<=length; i++){
    M[i][i] = 0;
  }

  for(l=2; l<=length; l++){
    for(i=1; i<length-l+1; i++){
      j = i+l-1;
      M[i][j] = INF;
      for(k=i; k<j-1; k++){
	q = M[i][k] + M[k+1][j] + p[i-1]*p[k]*p[j];
	if(M[i][j] > q) m[i][j] = q;
      }
    }
  }
  return M[i-1][j];
}

Compiler output:
main.c: In function 'matrixChainOrder':
main.c:40:25: error: 'm' undeclared (first use in this function)
   40 |         if(M[i][j] > q) m[i][j] = q;
      |                         ^
main.c:40:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>
#define N 100
#define INF 10000000
int M[N][N];

int matrixChainOrder(int*,int);

int main(){

  int i,j,n;
  int p[N];

  scanf("%d",&n);

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

  printf("%d\n",matrixChainOrder(p,n));

  return 0;
}

int matrixChainOrder(int *p,int length){

  int n,i,j,k,q;
  int l;

  for(i=1; i<=length; i++){
    M[i][i] = 0;
  }

  for(l=2; l<=length; l++){
    for(i=1; i<length-l+1; i++){
      j = i+l-1;
      M[i][j] = INF;
      for(k=i; k<j; k++){
	q = M[i][k] + M[k+1][j] + p[i-1]*p[k]*p[j];
	if(M[i][j] > q) m[i][j] = q;
      }
    }
  }
  return M[i-1][j];
}

Compiler output:
main.c: In function 'matrixChainOrder':
main.c:40:25: error: 'm' undeclared (first use in this function)
   40 |         if(M[i][j] > q) m[i][j] = q;
      |                         ^
main.c:40:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>
#define N 100
#define INF 10000000


int matrixChainOrder(int*,int);

int main(){

  int i,j,n;
  int p[N];

  scanf("%d",&n);

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

  printf("%d\n",matrixChainOrder(p,n));

  return 0;
}

int matrixChainOrder(int *p,int length){

  int i,j,k,q;
  int l;
  int M[N][N];

  for(i=1; i<=length; i++)
    M[i][i] = 0;

  for(l=2; l<=length; l++){
    for(i=1; i<length-l+1; i++){
      j = i+l-1;
      M[i][j] = INF;
      for(k=i; k<j; k++){
	q = M[i][k] + M[k+1][j] + p[i-1]*p[k]*p[j];
	if(M[i][j] > q) m[i][j] = q;
      }
    }
  }
  return M[i-1][j];
}

Compiler output:
main.c: In function 'matrixChainOrder':
main.c:40:25: error: 'm' undeclared (first use in this function)
   40 |         if(M[i][j] > q) m[i][j] = q;
      |                         ^
main.c:40:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

include<stdio.h>
#define MAX 100
#define INF -1

int n;

int MatrixChainOrder(int *);

int main()
{
  int i;
  int m[MAX][2],p[MAX];

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

  for(i = 0;i <= n;i++){
    p[i] = m[i][0];
    if(i == n) p[i] = m[i-1][1];
  }

  printf("%d\n",MatrixChainOrder(p));

  return 0;
}

int MatrixChainOrder(int *p)
{
  int i,j,k,l,q,x;
  int M[MAX][MAX];

  for(i = 1;i <= n;i++){
    M[i][i] = 0;
  }

  for(l = 2;l <= n;l++){
    for(i = 1;i <= n-l+1;i++){
      j = i + l - 1;
      M[i][j] = M[i][i] + M[i+1][j] + (p[i-1] * p[i]* p[j]);
      for(k = i;k <= j-1;k++){
        q = M[i][k] + M[k+1][j] + (p[i-1] * p[k] * p[j]);
        if(q < M[i][j]) M[i][j] = q;
      }
    }
  }

  return M[1][n];
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:14:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   14 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:14:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   14 |   scanf("%d",&n);
      |   ^~~~~
main.c:14:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:14:15: error: 'n' undeclared (first use in this function)
   14 |   scanf("%d",&n);
      |               ^
main.c:14:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   24 |   printf("%d\n",MatrixChainOrder(p));
      |   ^~~~~~
main.c:24:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:24:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'MatrixChainOrder':
main.c:34:18: error: 'n' undeclared (first use in this function)
   34 |   for(i = 1;i <= n;i++){
      |                  ^