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

#include<stdio.h>
#define N 100

void matrix()
{
   int i, j, k, l;

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

   for (l=1; l<n; l++){
      for (i=1; i<=n-l+1; i++){
         j = i+l-1;
         m[i][j] = 100000000; 
         for (k=i; k<j; k++){
            if (m[i][j] > m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j])
               m[i][j] = m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
         }
      }
   }


int main()
{
   int i;

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

   matrixChain();

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

   return 0;
}

Compiler output:
main.c: In function 'matrix':
main.c:8:16: error: 'n' undeclared (first use in this function)
    8 |    for (i=0; i<n; i++)
      |                ^
main.c:8:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:7: error: 'm' undeclared (first use in this function)
    9 |       m[i][i] = 0;
      |       ^
main.c:16:45: error: 'p' undeclared (first use in this function)
   16 |             if (m[i][j] > m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j])
      |                                             ^
main.c: In function 'main':
main.c:32:4: error: implicit declaration of function 'matrixChain' [-Wimplicit-function-declaration]
   32 |    matrixChain();
      |    ^~~~~~~~~~~
main.c: In function 'matrix':
main.c:37:1: error: expected declaration or statement at end of input
   37 | }
      | ^
Language: C

#include<stdio.h>
#define N 100

void matrixChain()
{
   int i, j, k, l;

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

   for (l=1; l<n; l++){
      for (i=1; i<=n-l+1; i++){
         j = i+l-1;
         m[i][j] = 100000000; 
         for (k=i; k<j; k++){
            if (m[i][j] > m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j])
               m[i][j] = m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
         }
      }
   }


int main()
{
   int i;

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

   matrixChain();

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

   return 0;
}

Compiler output:
main.c: In function 'matrixChain':
main.c:8:16: error: 'n' undeclared (first use in this function)
    8 |    for (i=0; i<n; i++)
      |                ^
main.c:8:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:7: error: 'm' undeclared (first use in this function)
    9 |       m[i][i] = 0;
      |       ^
main.c:16:45: error: 'p' undeclared (first use in this function)
   16 |             if (m[i][j] > m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j])
      |                                             ^
main.c:37:1: error: expected declaration or statement at end of input
   37 | }
      | ^
Language: C

#include<stdio.h>
#define N 100

int m[101][101], p[101], n;

void matrixChain()
{
   int i, j, k, l;

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

   for (l=1; l<n; l++){
      for (i=1; i<=n-l+1; i++){
         j = i+l-1;
         m[i][j] = 100000000; 
         for (k=i; k<j; k++){
            if (m[i][j] > m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j])
               m[i][j] = m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
         }
      }
   }


int main()
{
   int i;

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

   matrixChain();

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

   return 0;
}

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

#include<stdio.h>
#define N 100

int m[101][101], p[101], n;

void matrixChain()
{
   int i, j, k, 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] = 100000000; 
         for (k=i; k<j; k++){
            if (m[i][j] > m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j])
               m[i][j] = m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
         }
      }
   }


int main()
{
   int i;

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

   matrixChain();

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

   return 0;
}

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

#include<iostream>
#include<cstdio>
#include<climits>
using namespace std;

int m[105][105];
int plen;
//function matrix chain order
void matrixco(int p[]){
  int n,j,q;
  n=plen-1;
  for(int i=1;i<=n;i++){
    m[i][i]=0;
  }

  for(int l=2;l<=n;l++){
    for(int i=0;i<=n-l+1;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(q<m[i][j]){
	  m[i][j]=q;
	}
      }
    }
  }
}

int main(){
  int n;
  int p[105];
  int r,c;
  //load n
  cin >>n;

  plen=n+1;

  for(int i=0;i<n;i++){
    //load r,c
    scanf("%d %d",&r,&c);

    if(i!=n-1) p[i]=r;
    else{
      p[i]=r;
      p[i+1]=c;
    }
  }

  matrixco(p);

  cout <<m[1][n]<<endl;
  return 0;
}

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

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

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

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

int main()
{
  int N;
  int i, j;
	
  scanf("%d", &N);
  for (i = 0; i < N; i++){
    scanf("%d %d", &r[i], &c[i]);
  }
  for(i = 0; i < 100; i++){
    for(j = 0; j < 100; j++){
      M[i][j] = -1;
    }
  }
  printf("%d\n", matrix(0, N - 1));
  return 0;
}

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

#include<iostream>
#include<algorithm>
using namespace std;

static const int N=100;

int main(){
  int n,p[N+1],m[N+1][N+1];
  cin>>n;
  for(int i=0;i<=n;i++){
    cin>>p[i-1]>>p[i];
  }

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

  cout<<m[1][n]<<endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:24: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   20 |         m[i][j]=min(min[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      |                        ^
Language: C++

#include<stdio.h>
#include<cstdio>
#include<string>
#include<algorithm>

#define INF 100000001
using namespace std;

int DP[101][101];
int *p;

int rec(int r, int c) {
	int Min = INF;
	int num = c-r;
	
	for(int i= 0; i< num; i++) {
		Min = min(Min , DP[r][r+i] + DP[r+i+1][c] + p[r-1]*p[r-1]*p[r+i]*p[c]);
	}
	return Min;
}

int main() {
	int N; 
	cin >> N;
	for(int i=1; i <= N; i++) DP[i][i] =0;
	
	p=(int *)malloc(sizeof(int) * (N+1));
	
	cin >>p[0];
	cin >> p[1];
	int bb;
	for(int i = 1; i <= N; i ++) {
	
	cin >> bb;
	cin >> p[i];
	}
	for(int i =1; i < N; i++) DP[i][i+1] = p[i-1]*p[i] *p[i+1];
	
	for(int j=0; j <=N-3; j++) {
		for(int i = 3+j; i <=N; i++) {
			DP[i-2-j][i] = rec(i-2-j,i);
			}
			}
			cout << DP[1][N] << endl;
			return 0;
			}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'cin' was not declared in this scope
   24 |         cin >> N;
      |         ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include<algorithm>
  +++ |+#include <iostream>
    5 | 
a.cc:44:25: error: 'cout' was not declared in this scope
   44 |                         cout << DP[1][N] << endl;
      |                         ^~~~
a.cc:44:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:44:45: error: 'endl' was not declared in this scope
   44 |                         cout << DP[1][N] << endl;
      |                                             ^~~~
a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    4 | #include<algorithm>
  +++ |+#include <ostream>
    5 |
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;

static const in N = 100;

int main(){
  int j,i,l,n,p[N+1],m[N+1][N+1];
  scanf("%d",&n);

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

  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] = (1<<21);
      for(int k = i; k <=j-1;k++){
	m[i][j] = min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      }
    }
  }
  cout << m[1][n]<<endl;
  return 0;
}



Compiler output:
a.cc:5:14: error: 'in' does not name a type; did you mean 'int'?
    5 | static const in N = 100;
      |              ^~
      |              int
a.cc: In function 'int main()':
a.cc:8:17: error: 'N' was not declared in this scope
    8 |   int j,i,l,n,p[N+1],m[N+1][N+1];
      |                 ^
a.cc:12:20: error: 'p' was not declared in this scope
   12 |     scanf("%d %d",&p[i-1],&p[i]);
      |                    ^
a.cc:15:24: error: 'm' was not declared in this scope
   15 |   for(i = 1; i<=n;i++) m[i][i] = 0;
      |                        ^
a.cc:19:7: error: 'm' was not declared in this scope
   19 |       m[i][j] = (1<<21);
      |       ^
a.cc:21:49: error: 'p' was not declared in this scope
   21 |         m[i][j] = min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      |                                                 ^
a.cc:25:11: error: 'm' was not declared in this scope
   25 |   cout << m[1][n]<<endl;
      |           ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;

static const in N = 100;

int main(){
  int j,i,l,n,p[N+1],m[N+1][N+1];
  cin>>n;

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

  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] = (1<<21);
      for(int k = i; k <=j-1;k++){
	m[i][j] = min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      }
    }
  }
  cout << m[1][n]<<endl;
  return 0;
}




Compiler output:
a.cc:5:14: error: 'in' does not name a type; did you mean 'int'?
    5 | static const in N = 100;
      |              ^~
      |              int
a.cc: In function 'int main()':
a.cc:8:17: error: 'N' was not declared in this scope
    8 |   int j,i,l,n,p[N+1],m[N+1][N+1];
      |                 ^
a.cc:12:10: error: 'p' was not declared in this scope
   12 |     cin>>p[i-1]>>p[i];
      |          ^
a.cc:15:24: error: 'm' was not declared in this scope
   15 |   for(i = 1; i<=n;i++) m[i][i] = 0;
      |                        ^
a.cc:19:7: error: 'm' was not declared in this scope
   19 |       m[i][j] = (1<<21);
      |       ^
a.cc:21:49: error: 'p' was not declared in this scope
   21 |         m[i][j] = min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      |                                                 ^
a.cc:25:11: error: 'm' was not declared in this scope
   25 |   cout << m[1][n]<<endl;
      |           ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;

static const in N = 100;

int main(){
  int n,p[N+1],m[N+1][N+1];
  cin>>n;

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

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



Compiler output:
a.cc:5:14: error: 'in' does not name a type; did you mean 'int'?
    5 | static const in N = 100;
      |              ^~
      |              int
a.cc: In function 'int main()':
a.cc:8:11: error: 'N' was not declared in this scope
    8 |   int n,p[N+1],m[N+1][N+1];
      |           ^
a.cc:12:10: error: 'p' was not declared in this scope
   12 |     cin>>p[i-1]>>p[i];
      |          ^
a.cc:15:28: error: 'm' was not declared in this scope
   15 |   for(int i = 1; i<=n;i++) m[i][i] = 0;
      |                            ^
a.cc:18:7: error: 'j' was not declared in this scope
   18 |       j = i+l-1;
      |       ^
a.cc:19:7: error: 'm' was not declared in this scope
   19 |       m[i][j] = (1<<21);
      |       ^
a.cc:21:49: error: 'p' was not declared in this scope
   21 |         m[i][j] = min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      |                                                 ^
a.cc:25:11: error: 'm' was not declared in this scope
   25 |   cout << m[1][n]<<endl;
      |           ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;

static const int N = 100;

int main(){
  int n,p[N+1],m[N+1][N+1];
  cin>>n;

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'j' was not declared in this scope
   18 |       j = i+l-1;
      |       ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;

static const int N=100;

int main()
{
  int n,p[N+1],m[N+1][N+1];
  cin >> n;
  for(int i=1; i<=n; i++)
    {
      cin>>p[i-1]>>p[i];
    }

  for(int i=1;i<=n;i++)
    {
    m[i][i]=0;
    }
  for(int l=2;l<=n;l++)
    x{
      for(int i=1; i<=n-l+1;i++)
	{
	  int j=i+l-1;
	  m[i][j]=(1<<21);
	  for(int k=i;k<=j-1;k++)
	    {
	      m[i][j]=min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
	    }
	}
    }
  cout<<m[1][n]<<endl;

  return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'x' was not declared in this scope
   21 |     x{
      |     ^
Language: C++

#include "stdafx.h"
#include <iostream>
#include <algorithm>
using namespace std;



static const int N = 100;

int main()
{
	int n, p[N + 1], m[N + 1][N + 1];
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> p[i - 1] >> p[i];
	}

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

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

	cout << m[1][n] << endl;

    return 0;
}


Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

static const int N = 100;

int main() {
  int n, p[N+1], m[N+1][N+1];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> p[i-1] >> p[i];
  }

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

  cout << m[1][n] << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:36: error: expected ';' before 'm'
   13 |   for (int i = 1; i <= n; i++) m[i]m[i] = 0;
      |                                    ^
      |                                    ;
Language: C++

#include <iostream>
#include <cstdio>
#include <map>
#define MAX_NUM 100
#define INFTY 1000000000
#define NIL -1

using namespace std;

//think easy make easy

int n;//num of input


pair<int,int> MatrixChain[MAX_NUM+1];
map<pair<int,int>,int> map;

int calc(int s,int e){//s~eの連鎖行列積の最少計算回数を出力
	int min_time  = INFTY;
	int min_tmp;

	if(map[s,e] != NIL)
		return map[s,e];

	if(s == e){
		return 0;
	}
	for(int i=s;i<e;i++){
		min_tmp = calc(s,i) + calc(i+1,e) 
			+MatrixChain[s].first*MatrixChain[i].second*MatrixChain[e].second;
		if(min_tmp < min_time)
			min_time = min_tmp;
	}
	map[s,e] = min_time;//メモ
	return min_time;
}

int main(){
	scanf("%d",&n);
	int r,c;//row,column

	for(int i=0;i<n;i++){
		scanf("%d %d",&r,&c);
		MatrixChain[i] = pair<int,int>(r,c);//i:1~n-1
	}
	for(int i=0;i<n;i++){
		for(int j=i;j<n;j++){
			map[i][j] = NIL;
		}
	}

	cout <<calc(0,n-1) <<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int calc(int, int)':
a.cc:22:12: error: reference to 'map' is ambiguous
   22 |         if(map[s,e] != NIL)
      |            ^~~
In file included from /usr/include/c++/14/map:63,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:16:24: note:                 'std::map<std::pair<int, int>, int> map'
   16 | map<pair<int,int>,int> map;
      |                        ^~~
a.cc:23:24: error: reference to 'map' is ambiguous
   23 |                 return map[s,e];
      |                        ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:16:24: note:                 'std::map<std::pair<int, int>, int> map'
   16 | map<pair<int,int>,int> map;
      |                        ^~~
a.cc:34:9: error: reference to 'map' is ambiguous
   34 |         map[s,e] = min_time;//メモ
      |         ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:16:24: note:                 'std::map<std::pair<int, int>, int> map'
   16 | map<pair<int,int>,int> map;
      |                        ^~~
a.cc: In function 'int main()':
a.cc:48:25: error: reference to 'map' is ambiguous
   48 |                         map[i][j] = NIL;
      |                         ^~~
/usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:16:24: note:                 'std::map<std::pair<int, int>, int> map'
   16 | map<pair<int,int>,int> map;
      |                        ^~~
Language: C++

#include <iostream>
#include <algorithm>

#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
const int INF=1e9;
int n;
int r[102],c[102];
int p[102];

int dp[102][102];
// [i,j)
int dfs(int i,int j) {
    //cout<<i<<", "<<j<<endl;
    if(dp[i][j]!=-1) return dp[i][j];
    if(j-i==1) return r[i]*c[i]*c[j-1];
    if(i==j) return 0;
    int ret=INF;
    for(int k=i+1;k<j;k++) {
        //ret=min(ret,dfs(i,k)+dfs(k,j)+r[i]*c[k]*c[j-1]);
        ret=min(ret,dfs(i,k)+dfs(k,j)+p[i]*p[k]*p[j]);
    }

    return dp[i][j]=ret;
}

int main() {
    memset(dp,-1,sizeof(dp));
    cin>>n;
    //rep(i,n) cin>>r[i]>>c[i];
    rep(i,n+1) if(i) cin>>p[i-1]>>p[i];
    cout<<dfs(0,n)<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'memset' was not declared in this scope
   28 |     memset(dp,-1,sizeof(dp));
      |     ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 |
Language: C++

#include<iostream>
#include<string>
#include<algorithm>

int lcs(std::string x, std::string y) {
	int c[101][101];
	int m = x.size();
	int n = y.size();
	int maxl = 0;
	x = ' ' + x;
	y = ' ' + y;
	for (int i = 1; i <= m; i++) {
		c[i][0] = 0;
	}
	for (int i = 1; i <= n; i++) {
		c[0][j] = 0;
	}

	for (int i = 1; i <= m; i++) {
		for (int j = 1; j <= n; j++) {
			if (x[i] == y[j]) {
				c[i][j] = c[i - 1][j - 1] + 1;
			} else {
				c[i][j] = std::max(c[i - 1][j], c[i][j - 1]);
			}
			maxl = std::max(maxl, c[i][j]);
		}
	}
	return maxl;
}


int main() {
	std::string s1, s2;
	int n;
	std::cin >> n;
	for (int i = 0; i < n; i++) {
		std::cin >> s1 >> s2;
		std::cout << lcs(s1, s2) << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int lcs(std::string, std::string)':
a.cc:16:22: error: 'j' was not declared in this scope
   16 |                 c[0][j] = 0;
      |                      ^
Language: C++

def edit_distance(d)
 n =len(d)
 A=[[0 for i inrange(n)] for j in range(n)]
 for long in range(0,n+1-long):
  k=i-1+long
  def f(i,j,k):
   return A[i][j-1]+A[j][k]+]+M[i][0]*M[j-1][1]*M[k][1]
   A[i][k] = min([f(i,j,k) for j in range(i+1,k+1)])
 return A[0][n-1]
n = input()
M = []
for i in range(n):
 M.append(map(int, raw_input().split()))
print edit_distance (M)

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def edit_distance(d)
      | ^~~
Language: C++

#include <iostream>

using namespace std;
int main() {
	int n;
	cin >> n;



	int dp[n][n];

	for( int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			dp[i][j] = 0;
		}
	}

	int p[n + 1];

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


	// |--**+-|

	// |+*---| l = 2, i = 0, j=0 : p(0) * P(1) * P (2)
	// |-+*--| l = 2, i = 1, j = 1 : p(1) * p(2) * p (3); p (i) * p(j+1) * p(i+l+1)
	// |---+*| l = 2, i = 1, j = 2
	// |-++*-| l = 3, i = 1, j = 3 : p(1) * p(3) * p(4)
	// |-****| 

	// 1 2 3   1 * 2 * 3

	for (int l = 2; l <= n; l++) {
		for (int i = 0; i < n - l + 1; i++) {
			int min = INT_MAX;
			for (int j = i; j < i + l - 1;j++ ) {
				int t = dp[i][j] + p[i] * p[j + 1] * p[i + l] + dp[j+1][i + l - 1];
				if (t < min) {
					min = t;
				}
			}
			dp[i][i + l - 1] = min;
			//cout << "i:" << i << " j:" << i + l - 1 << " max:" << min << endl;
		}
	}

	cout << dp[0][n -1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:35: error: 'INT_MAX' was not declared in this scope
   37 |                         int min = INT_MAX;
      |                                   ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 |
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

#define N 100

int M[101][101], p[101], n;

int solve()
{
	int l, i, j, k;
	for (l = 2; l <= n; l++) {
		for (i = 1; i <= n - l + 1; i++) {
			j = i + l - 1;
			M[i][j] = INT32_MAX;
			for (k = i; k < j; k++)
				M[i][j] = min(M[i][j], M[i][k] + M[k + 1][j] + p[i - 1] * p[k] * p[j]);
		}
	}
	return M[1][n];
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> p[i - 1] >> p[i];

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

	cout << solve() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:15:35: error: 'INT32_MAX' was not declared in this scope
   15 |                         M[i][j] = INT32_MAX;
      |                                   ^~~~~~~~~
a.cc:3:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    2 | #include <algorithm>
  +++ |+#include <cstdint>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

#define N 100

int M[101][101], p[101], n;

int solve()
{
	int l, i, j, k;
	for (l = 2; l <= n; l++) {
		for (i = 1; i <= n - l + 1; i++) {
			j = i + l - 1;
			M[i][j] = INT32_MAX;
			for (k = i; k < j; k++)
				M[i][j] = min(M[i][j], M[i][k] + M[k + 1][j] + p[i - 1] * p[k] * p[j]);
		}
	}
	return M[1][n];
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> p[i - 1] >> p[i];

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

	cout << solve() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:16:35: error: 'INT32_MAX' was not declared in this scope
   16 |                         M[i][j] = INT32_MAX;
      |                                   ^~~~~~~~~
a.cc:4:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    3 | #include <cmath>
  +++ |+#include <cstdint>
    4 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
int n, r[111], c[111], dp[111][111];
int main() {
	cin >> n;
	for(int i = 0; i < n; i++) cin >> r[i] >> c[i];
	for(int i = 2; i <= n; i++) {
		for(int j = 0; j <= n - i; j++) {
			int l = j, r = j + i; // [l, r)
			dp[l][r] = 999999999;
			for(int k = l + 1; k < r; k++) {
				dp[l][r] = min(dp[l][r], dp[l][k] + dp[k][r] + r[l] * c[r]);
			}
		}
	}
	cout << dp[0][n] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:81: error: invalid types 'int[int]' for array subscript
   12 |                                 dp[l][r] = min(dp[l][r], dp[l][k] + dp[k][r] + r[l] * c[r]);
      |                                                                                 ^
Language: C++

#include <iostream> 
#include <math.h> 
 
using namespace std; 
 
int r[45] = {0}; 
int a[100][100] = {0}; 
 
int f(int n, int m); 
int f(int n, int k, int m); 
 
 
int f(int n, int k, int m) 
{ 
    return f(n,k) * f(k+1,m) + (r[n] * r[k+1] * r[m+1]); 
} 
 
int f(int n, int m) 
{ 
    if (n==m) return 1; 
    int & ra = a[n][m]; 
    if (ra) return ra; 
    ra = INT_MAX; 
    for (int k=n;k<m;k++) 
    { 
        int ans = f(n,k,m); 
        if (ans < ra) ra = ans; 
    } 
    return ra; 
} 
 
int main() 
{ 
    int rr = 0; 
    int cc = 0; 
    int n = 0; 
    cin >> n; 
    for (int i=0;i<n;i++) 
    { 
        cin >> rr >> cc; 
        r[i]=rr; 
        r[i+1]=cc; 
    } 
    for (int i=0;i<n-1;i++) 
    { 
        a[i][i+1] = r[i] * r[i+1] * r[i+2]; 
    } 
    int ans = f(0,n-1); 
    cout << ans << endl; 
} 

Compiler output:
a.cc: In function 'int f(int, int)':
a.cc:23:10: error: 'INT_MAX' was not declared in this scope
   23 |     ra = INT_MAX;
      |          ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <math.h>
  +++ |+#include <climits>
    3 |
Language: C++

#include <iostream> 
#include <cmath> 
 
using namespace std; 
 
int r[45] = {0}; 
int a[100][100] = {0}; 
 
int f(int n, int m); 
int f(int n, int k, int m); 
 
 
int f(int n, int k, int m) 
{ 
    return f(n,k) * f(k+1,m) + (r[n] * r[k+1] * r[m+1]); 
} 
 
int f(int n, int m) 
{ 
    if (n==m) return 1; 
    int & ra = a[n][m]; 
    if (ra) return ra; 
    ra = INT_MAX; 
    for (int k=n;k<m;k++) 
    { 
        int ans = f(n,k,m); 
        if (ans < ra) ra = ans; 
    } 
    return ra; 
} 
 
int main() 
{ 
    int rr = 0; 
    int cc = 0; 
    int n = 0; 
    cin >> n; 
    for (int i=0;i<n;i++) 
    { 
        cin >> rr >> cc; 
        r[i]=rr; 
        r[i+1]=cc; 
    } 
    for (int i=0;i<n-1;i++) 
    { 
        a[i][i+1] = r[i] * r[i+1] * r[i+2]; 
    } 
    int ans = f(0,n-1); 
    cout << ans << endl; 
} 

Compiler output:
a.cc: In function 'int f(int, int)':
a.cc:23:10: error: 'INT_MAX' was not declared in this scope
   23 |     ra = INT_MAX;
      |          ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <cmath>
  +++ |+#include <climits>
    3 |
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
static const Aint N = 100;
int main() {
	int n, p[N + 1], m[N + 1][N + 1];
	cin >> n;
	for (int i = 1; i <= n; i++)cin >> p[i - 1] >> p[i];
	for (int i = 1; i <= n; i++)m[i][i] = 0;
	for (int l = 2; l <= n; l++) {
		for (int i = 1; i <= n - l + 1; i++) {
			int j = i + l - 1;
			m[i][j] = (1 << 21);
			for (int k = i; k <= j - 1; k++) {
				m[i][j] = min(m[i][j], m[i][k] + m[k+1][j] + m[k + 1][j] + p[i - 1] * p[k] * p[j]);
			}
		}
	}
	cout << m[1][n] << endl;
	return 0;
}

Compiler output:
a.cc:4:14: error: 'Aint' does not name a type; did you mean 'uint'?
    4 | static const Aint N = 100;
      |              ^~~~
      |              uint
a.cc: In function 'int main()':
a.cc:6:18: error: 'N' was not declared in this scope
    6 |         int n, p[N + 1], m[N + 1][N + 1];
      |                  ^
a.cc:8:44: error: 'p' was not declared in this scope
    8 |         for (int i = 1; i <= n; i++)cin >> p[i - 1] >> p[i];
      |                                            ^
a.cc:9:37: error: 'm' was not declared in this scope
    9 |         for (int i = 1; i <= n; i++)m[i][i] = 0;
      |                                     ^
a.cc:13:25: error: 'm' was not declared in this scope
   13 |                         m[i][j] = (1 << 21);
      |                         ^
a.cc:15:92: error: 'p' was not declared in this scope
   15 |                                 m[i][j] = min(m[i][j], m[i][k] + m[k+1][j] + m[k + 1][j] + p[i - 1] * p[k] * p[j]);
      |                                                                                            ^
a.cc:19:17: error: 'm' was not declared in this scope
   19 |         cout << m[1][n] << endl;
      |                 ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;

static const int N = 100;

int main(){
  int n,p[N+1],m[N+1][N+1];
  cin >> n;

  for(int i=1;i<=n;i++){
    cin >> p[i-1] >> p[i];
  }

  for(int i=1;i<=n;i++) m[i][j]=0;
  for(int l=2;i<=n;i++){
    for(int i=1;i<=n-l+1;i++){
      int j=i+l-1;
      m[i][j]=(1<<21);
      for(int k=i;k<=j-1;k++){
        m[i][j]=min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      }
    }
  }
  cout << m[1][n] << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:30: error: 'j' was not declared in this scope
   15 |   for(int i=1;i<=n;i++) m[i][j]=0;
      |                              ^
a.cc:16:15: error: 'i' was not declared in this scope
   16 |   for(int l=2;i<=n;i++){
      |               ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main() {
  int i, j, n, k, m[101], dp[101][101], s, t;
  
  scanf("%d", &n);
  for (i=0; i<n*2; i++)
    scanf("%d", &m[i]);  

  for (i=0; i<n; i++)
    for (j=0; j<n; j++)
      dp[i][j]=0;
 
  for (k=2; k<n; k++) {
    for (i=1; i<n-k+1; i++) {
     j=i+k-1;
     for (s=i; s<i; s++)
       dp[i][j]=m[s]*dp[i][j];
     for(t=0; t<j-1; t++)
       dp[i][j]=min(dp[i][j], dp[i][k]+dp[k+1][j]+m[i-1]*m[t]*m[j]);
    }
  }
  printf("%d",dp[1][n]);
  
  return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'min' was not declared in this scope; did you mean 'std::min'?
   21 |        dp[i][j]=min(dp[i][j], dp[i][k]+dp[k+1][j]+m[i-1]*m[t]*m[j]);
      |                 ^~~
      |                 std::min
In file included from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from /usr/include/c++/14/math.h:36,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

static const int N = 100;

int main() {
     int n, p[N + 1], m[N + 1][N + 1];
     cin >> n;
     for ( int i = 1; i <= n; i++ ) {
          cin >> p[i - 1] >> p[i];
     }

     for ( int i = 1; i <= n; i++ )   m[i][i] = 0;
     for ( int l = 2; l <= n; l++ ) {
          for ( i = 1; i <= n - l + 1; i++ ) {
               int j = i + l - 1;
               m[i][j] = (1 << 21);
               for ( int k = i; k <= j - 1; k ++ ) {
                    m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j]);
               }
          }
     }
     cout << m[1][n] << endl;

     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'i' was not declared in this scope
   16 |           for ( i = 1; i <= n - l + 1; i++ ) {
      |                 ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;

static const int N = 100;

int main() {
     int n, p[N + 1], m[N + 1][N + 1];
     cin >> n;
     for ( int i = 1; i <= n; i++ ) {
          cin >> p[i - 1] >> p[i];
     }

     for ( int i = 1; i <= n; i++ )   m[i][i] = 0;
     for ( int l = 2; l <= n; l++ ) {
          for ( i = 1; i <= n - l + 1; i++ ) {
               int j = i + l - 1;
               m[i][j] = (1 << 21);
               for ( int k = i; k <= j - 1; k ++ ) {
                    m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j]);
               }
          }
     }
     cout << m[1][n] << endl;

     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'i' was not declared in this scope
   16 |           for ( i = 1; i <= n - l + 1; i++ ) {
      |                 ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

const int N = 100;

int main() {
     int n, p[N + 1], m[N + 1][N + 1];
     cin >> n;
     for ( int i = 1; i <= n; i++ ) {
          cin >> p[i - 1] >> p[i];
     }

     for ( int i = 1; i <= n; i++ )   m[i][i] = 0;
     for ( int l = 2; l <= n; l++ ) {
          for ( i = 1; i <= n - l + 1; i++ ) {
               int j = i + l - 1;
               m[i][j] = (1 << 21);
               for ( int k = i; k <= j - 1; k ++ ) {
                    m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j]);
               }
          }
     }
     cout << m[1][n] << endl;

     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'i' was not declared in this scope
   16 |           for ( i = 1; i <= n - l + 1; i++ ) {
      |                 ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

const long N = 100;

int main() {
     long n, p[N + 1], m[N + 1][N + 1];
     cin >> n;
     for ( long i = 1; i <= n; i++ ) {
          cin >> p[i - 1] >> p[i];
     }

     for ( long i = 1; i <= n; i++ )   m[i][i] = 0;
     for ( long l = 2; l <= n; l++ ) {
          for ( i = 1; i <= n - l + 1; i++ ) {
               long j = i + l - 1;
               m[i][j] = (1 << 21);
               for ( long k = i; k <= j - 1; k ++ ) {
                    m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j]);
               }
          }
     }
     cout << m[1][n] << endl;

     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'i' was not declared in this scope
   16 |           for ( i = 1; i <= n - l + 1; i++ ) {
      |                 ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

const int N = 100;

int main() {
     int n, p[N + 1], m[N + 1][N + 1];
     cin >> n;
     for ( int i = 1; i <= n; i++ ) {
          cin >> p[i - 1] >> p[i];
     }

     for ( int i = 1; i <= n; i++ )   m[i][i] = 0;
     for ( int l = 2; l <= n; l++ ) {
          for ( i = 1; i <= n - l + 1; i++ ) {
               int j = i + l - 1;
               m[i][j] = (1 << 21);
               for ( int k = i; k <= j - 1; k++ ) {
                    m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j]);
               }
          }
     }
     cout << m[1][n] << endl;

     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'i' was not declared in this scope
   16 |           for ( i = 1; i <= n - l + 1; i++ ) {
      |                 ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

static const int N = 100;

int main() {
     int n, p[N + 1], m[N + 1][N + 1];
     cin >> n;
     for ( int i = 1; i <= n; i++ ) {
          cin >> p[i - 1] >> p[i];
     }

     for ( int i = 1; i <= n; i++ ) {
          m[i][i] = 0;
     }
     for ( int l = 2; l <= n; l++ ) {
          for ( i = 1; i <= n - l + 1; i++ ) {
               int j = i + l - 1;
               m[i][j] = (1 << 21);
               for ( int k = i; k <= j - 1; k++ ) {
                    m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j]);
               }
          }
     }
     cout << m[1][n] << endl;

     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'i' was not declared in this scope
   18 |           for ( i = 1; i <= n - l + 1; i++ ) {
      |                 ^
Language: C++

#include<stdio.h>
#include<algorithm>
using namespace std;

static const int N = 100;

int main(){
  int n, p[N + 1], m[N + 1][N + 1];
  cin >> n;l <= n; l++){
  for( int i = 1; i <= n; i++){
    cin >> p[i - 1] >> p[i];
  }
  
  for( int i = 1; i <= n; i++) m[i][i] = 0;
  for( int l = 2; l <= n; l++){
    for( int i = 1; i <= n - 1; i++){
      int j = i + l - 1;
      m[i][j] = (1 << 21);
      for( int k = i; k <= j - 1; k++){
        m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + p[i - 1]*p[k]*p[j]);
      }
    }
  }
  
  cout << m[1][n] << endl;
  
  return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> n;l <= n; l++){
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<algorithm>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:9:12: error: 'l' was not declared in this scope
    9 |   cin >> n;l <= n; l++){
      |            ^
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<algorithm>
using namescape std;

static const int N = 100;

int main(){
  int n,p[n+1],m[N+1][N+1];
  cin >> n;
  for (int i=1;i<=n;i++){
    cin >> p[i-1] >> p[i];
  }

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

  cout << m[1][n] << endl;
  
  return 0;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namescape'
    3 | using namescape std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:17: error: 'min' was not declared in this scope; did you mean 'std::min'?
   20 |         m[i][j]=min(m[i][j], m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      |                 ^~~
      |                 std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:25:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |   cout << m[1][n] << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   25 |   cout << m[1][n] << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
using namescape std;

static const int N = 100;

int main(){
  int n,p[N+1],m[N+1][N+1];
  cin >> n;
  for (int i=1;i<=n;i++){
    cin >> p[i-1] >> p[i];
  }

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

  cout << m[1][n] << endl;
  
  return 0;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namescape'
    3 | using namescape std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:17: error: 'min' was not declared in this scope; did you mean 'std::min'?
   20 |         m[i][j]=min(m[i][j], m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      |                 ^~~
      |                 std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:25:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |   cout << m[1][n] << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   25 |   cout << m[1][n] << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
using namescape std;

static const int N = 100;

int main(){
  int n,p[N+1],m[N+1][N+1];
  cin >> n;
  for (int i=1;i<=n;i++){
    cin >> p[i-1] >> p[i];
  }

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

  cout << m[1][n] << endl;
  
  return 0;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namescape'
    3 | using namescape std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:17: error: 'min' was not declared in this scope; did you mean 'std::min'?
   20 |         m[i][j]=min(m[i][j], m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      |                 ^~~
      |                 std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:25:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |   cout << m[1][n] << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   25 |   cout << m[1][n] << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>

class TMinimumMultiplications
{
	std::vector<std::vector<int> > FTable;
	std::vector<std::pair<int, int> >& FMatrixChain;
	
	int GetMinimum(int Begin, int End);
public:
	TMinimumMultiplications(std::vector<std::pair<int, int> >& MatrixChain);
	
	int Get(int Begin, int End);
};

TMinimumMultiplications::TMinimumMultiplications(std::vector<std::pair<int, int> >& MatrixChain)
: FMatrixChain(MatrixChain), FTable(MatrixChain.size(), std::vector<int>(MatrixChain.size(), -1))
{
}

int TMinimumMultiplications::GetMinimum(int Begin, int End)
{
	int Minimum = INT_MAX;
	for(int i = Begin; i < End; ++i){
		int Total = Get(Begin, i) + Get(i + 1, End) + FMatrixChain[Begin].first * FMatrixChain[i + 1].first * FMatrixChain[End].second;
		if(Minimum > Total) Minimum = Total;
	}
	return Minimum;
}

int TMinimumMultiplications::Get(int Begin, int End)
{
	if(Begin == End) return 0;
	if(FTable[Begin][End] < 0){
		FTable[Begin][End] = GetMinimum(Begin, End);
	}
	return FTable[Begin][End];
}

int main()
{
	int Count;
	std::cin >> Count;
	std::vector<std::pair<int, int> > MatrixChain;
	for(int i = 0; i < Count; ++i){
		int Row, Col;
		std::cin >> Row >> Col;
		MatrixChain.push_back(std::make_pair(Row, Col));
	}
	TMinimumMultiplications Minimum(MatrixChain);
	std::cout << Minimum.Get(0, MatrixChain.size() - 1) << std::endl;
	return 0;
}

Compiler output:
a.cc: In member function 'int TMinimumMultiplications::GetMinimum(int, int)':
a.cc:23:23: error: 'INT_MAX' was not declared in this scope
   23 |         int Minimum = INT_MAX;
      |                       ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <vector>
  +++ |+#include <climits>
    3 |
Language: C++

#include <iostream>
#include <limits>
#include <vector>

class TMinimumMultiplications
{
	std::vector<std::vector<int> > FTable;
	std::vector<std::pair<int, int> >& FMatrixChain;
	
	int GetMinimum(int Begin, int End);
public:
	TMinimumMultiplications(std::vector<std::pair<int, int> >& MatrixChain);
	
	int Get(int Begin, int End);
};

TMinimumMultiplications::TMinimumMultiplications(std::vector<std::pair<int, int> >& MatrixChain)
: FMatrixChain(MatrixChain), FTable(MatrixChain.size(), std::vector<int>(MatrixChain.size(), -1))
{
}

int TMinimumMultiplications::GetMinimum(int Begin, int End)
{
	int Minimum = INT_MAX;
	for(int i = Begin; i < End; ++i){
		int Total = Get(Begin, i) + Get(i + 1, End) + FMatrixChain[Begin].first * FMatrixChain[i + 1].first * FMatrixChain[End].second;
		if(Minimum > Total) Minimum = Total;
	}
	return Minimum;
}

int TMinimumMultiplications::Get(int Begin, int End)
{
	if(Begin == End) return 0;
	if(FTable[Begin][End] < 0){
		FTable[Begin][End] = GetMinimum(Begin, End);
	}
	return FTable[Begin][End];
}

int main()
{
	int Count;
	std::cin >> Count;
	std::vector<std::pair<int, int> > MatrixChain;
	for(int i = 0; i < Count; ++i){
		int Row, Col;
		std::cin >> Row >> Col;
		MatrixChain.push_back(std::make_pair(Row, Col));
	}
	TMinimumMultiplications Minimum(MatrixChain);
	std::cout << Minimum.Get(0, MatrixChain.size() - 1) << std::endl;
	return 0;
}

Compiler output:
a.cc: In member function 'int TMinimumMultiplications::GetMinimum(int, int)':
a.cc:24:23: error: 'INT_MAX' was not declared in this scope
   24 |         int Minimum = INT_MAX;
      |                       ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <vector>
  +++ |+#include <climits>
    4 |