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

import java.util.Scanner;

public class alds1_10 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String X = null, Y = null;
        int[][] dp = new int[1001][1001];

        int q = sc.nextInt();

        for (int i = 0; i < q; ++i) {
            X = sc.next();
            Y = sc.next();
            for (int x = 0; x < X.length(); ++x) {
                for (int y = 0; y < Y.length(); ++y) {
                    if (X.charAt(x) == Y.charAt(y)) {
                        dp[x + 1][y + 1] = dp[x][y] + 1;
                    }
                    else {
                        if (dp[x + 1][y] > dp[x][y + 1]) {
                            dp[x + 1][y + 1] = dp[x + 1][y];
                        }
                        else {
                            dp[x + 1][y + 1] = dp[x][y + 1];
                        }
                    }
                }
            }
            System.out.printf("%d\n", dp[X.length()][Y.length()]);
        }
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class alds1_10 {
      | ^~~~~~
Language: C++

import java.util.*;

public class alds1_10 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String X = null, Y = null;
        int[][] dp = new int[1001][1001];

        int q = sc.nextInt();

        for (int i = 0; i < q; ++i) {
            X = sc.next();
            Y = sc.next();
            for (int x = 0; x < X.length(); ++x) {
                for (int y = 0; y < Y.length(); ++y) {
                    if (X.charAt(x) == Y.charAt(y)) {
                        dp[x + 1][y + 1] = dp[x][y] + 1;
                    }
                    else {
                        if (dp[x + 1][y] > dp[x][y + 1]) {
                            dp[x + 1][y + 1] = dp[x + 1][y];
                        }
                        else {
                            dp[x + 1][y + 1] = dp[x][y + 1];
                        }
                    }
                }
            }
            System.out.printf("%d\n", dp[X.length()][Y.length()]);
        }
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class alds1_10 {
      | ^~~~~~
Language: C++

import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String X = null, Y = null;
        int[][] dp = new int[1001][1001];

        int q = sc.nextInt();

        for (int i = 0; i < q; ++i) {
            X = sc.next();
            Y = sc.next();
            for (int x = 0; x < X.length(); ++x) {
                for (int y = 0; y < Y.length(); ++y) {
                    if (X.charAt(x) == Y.charAt(y)) {
                        dp[x + 1][y + 1] = dp[x][y] + 1;
                    }
                    else {
                        if (dp[x + 1][y] > dp[x][y + 1]) {
                            dp[x + 1][y + 1] = dp[x + 1][y];
                        }
                        else {
                            dp[x + 1][y + 1] = dp[x][y + 1];
                        }
                    }
                }
            }
            System.out.printf("%d\n", dp[X.length()][Y.length()]);
        }
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String X = null, Y = null;
        int[][] dp = new int[1001][1001];

        int q = sc.nextInt();

        for (int i = 0; i < q; ++i) {
            X = sc.next();
            Y = sc.next();
            for (int x = 0; x < X.length(); ++x) {
                for (int y = 0; y < Y.length(); ++y) {
                    if (X.charAt(x) == Y.charAt(y)) {
                        dp[x + 1][y + 1] = dp[x][y] + 1;
                    }
                    else {
                        if (dp[x + 1][y] > dp[x][y + 1]) {
                            dp[x + 1][y + 1] = dp[x + 1][y];
                        }
                        else {
                            dp[x + 1][y + 1] = dp[x][y + 1];
                        }
                    }
                }
            }
            System.out.printf("%d\n", dp[X.length()][Y.length()]);
        }
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

int dp[1010][1010];



int solve() {

	string s,t;

	cin >> s >> t;


	int max_s = s.length();
	int max_t = t.length();

	memset(dp,0, sizeof(int) * 1010 * 1010);



	for (int i = 1; i <= max_s; i++) {
		for (int j = 1; j <= max_t; j++) {
			if (s.at(i - 1) == t.at(j -1)) {
				dp[i][j] = dp[i - 1][j - 1] + 1;
			} else {
				dp[i][j] = max(dp[i][j - 1],dp[i -1][j]);			
			}
		}
	}
	return dp[max_s][max_t];
}

int main() {
	int q;

	cin >> q;

	for (int i = 0; i  < q; i++) {
		cout << solve() << endl;
	}

}

Compiler output:
a.cc: In function 'int solve()':
a.cc:21:9: error: 'memset' was not declared in this scope
   21 |         memset(dp,0, sizeof(int) * 1010 * 1010);
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <cmath>
  +++ |+#include <cstring>
    4 |
Language: C++

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x);
#define if_range(x, w, h) if (w <= x && x <= h)
#define BitCheck(a,b)   (a >> b) & 1
#define BitSet(a,b)       a |= (1 << b)
#define BitunSet(a,b)    a &= ~(1 << b)

int compare_int(const void* a, const void* b) { return *(int*) a - *(int*) b; }

int main() {
	int n, m, a, dp[102][102] = { 0 };
	char s[1001], t[1001];
	scanf("%d", &a);
	for (int k = 0; a > k; k++) {
		scanf("%d %d %s %s", &n, &m, s, t);
		for (int i = 1; n >= i; i++) {
			for (int j = 1; m >= j; j++) {
				if (s[i - 1] == t[j - 1])dp[i][j] = dp[i - 1][j - 1] + 1;
				else dp[i][j] = __max(dp[i - 1][j], dp[i][j - 1]);
			}
		}
		printf("%d\n", dp[n][m]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:49: error: '__max' was not declared in this scope
   36 |                                 else dp[i][j] = __max(dp[i - 1][j], dp[i][j - 1]);
      |                                                 ^~~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x);
#define if_range(x, w, h) if (w <= x && x <= h)
#define BitCheck(a,b)   (a >> b) & 1
#define BitSet(a,b)       a |= (1 << b)
#define BitunSet(a,b)    a &= ~(1 << b)

int compare_int(const void* a, const void* b) { return *(int*) a - *(int*) b; }

int main() {
	int n, m, a, dp[102][102] = { 0 };
	char s[1001], t[1001];
	scanf("%d", &a);
	for (int k = 0; a > k; k++) {
		scanf("%s %s", s, t);
		n = strlen(s);
		m = strlen(t);
		for (int i = 1; n >= i; i++) {
			for (int j = 1; m >= j; j++) {
				if (s[i - 1] == t[j - 1])dp[i][j] = dp[i - 1][j - 1] + 1;
				else dp[i][j] = __max(dp[i - 1][j], dp[i][j - 1]);
			}
		}
		printf("%d\n", dp[n][m]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:49: error: '__max' was not declared in this scope
   38 |                                 else dp[i][j] = __max(dp[i - 1][j], dp[i][j - 1]);
      |                                                 ^~~~~
Language: C++

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

static const 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:5:14: error: 'N' does not name a type
    5 | static const N = 100;
      |              ^
a.cc: In function 'int main()':
a.cc:8:18: error: 'N' was not declared in this scope
    8 |         int n, p[N+1], m[N+1][N+1];
      |                  ^
a.cc:11:24: error: 'p' was not declared in this scope
   11 |                 cin >> p[i-1] >> p[i];
      |                        ^
a.cc:14:34: error: 'm' was not declared in this scope
   14 |         for (int i=1; i<=n; i++) m[i][i] = 0;
      |                                  ^
a.cc:18:25: error: 'm' was not declared in this scope
   18 |                         m[i][j] = 1 << 21;
      |                         ^
a.cc:20:74: error: 'p' was not declared in this scope
   20 |                                 m[i][j] = min(m[i][j], m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      |                                                                          ^
a.cc:25:17: error: 'm' was not declared in this scope
   25 |         cout << m[1][n] << endl;
      |                 ^
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<cstring>
using namespace std;

int LCS(int len[],char S[][1001]){//???????????????2?????§?????????
    int DP[1001][1001] = {};
    for (int i = 1; i <= len[0]; i++) {
        for (int j = 1; j <= len[1]; j++) {
            if(S[0][i-1] == S[1][j-1]){
                DP[i][j] = DP[i-1][j-1]+1;
            }else{
                DP[i][j] = max(DP[i-1][j],DP[i][j-1]);
            }
        }
    }
    
    return DP[len[0]][len[1]];
}

void solve(){
    char S[2][10001];
    scanf("%s %s",S[1],S[2]);
    len[0] = strlen(S[0]);
    len[1] = strlen(S[1]);
    int len[2];
    int ll;
    ll = LCS(len,S);
    printf("%d\n",ll);
}

int main(){
    int N;
    cin >> N;
    for (int i = 0; i < n; i++) {
        solve();
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:26:5: error: 'len' was not declared in this scope; did you mean 'mblen'?
   26 |     len[0] = strlen(S[0]);
      |     ^~~
      |     mblen
a.cc: In function 'int main()':
a.cc:37:25: error: 'n' was not declared in this scope
   37 |     for (int i = 0; i < n; i++) {
      |                         ^
Language: C++

#include<iostream>
#include<vector>b
using namespace std;
int main()
{
	int kurikaeshi;
	vector<int> answer;
	cin >> kurikaeshi;
	for (int variable = 0;variable < kurikaeshi;++variable) {
		char X[1024], Y[1024];
		int LX = 0, LY = 0;
		vector<vector<int>> L;
		cin >> X >> Y;
		for (int i = 0;X[i] != 0;++i) LX += 1;
		for (int j = 0;Y[j] != 0;++j) LY += 1;
		L.resize(LX+1);
		for (int k = 0;k < LX + 1;++k) L[k].resize(LY+1);
		for (int i = 0;X[i] != 0;++i) {
			for (int j = 0;Y[j] != 0;++j) {
				if (i == 0 || j == 0) {
					L[i][j] = 0;
				}
				else if (X[i] == Y[j]) {
					L[i+1][j+1] = L[i+1][j] + 1;
				}
				else {
					L[i+1][j+1] = L[i][j+1] > L[i+1][j] ? L[i][j+1] : L[i+1][j];
				}
			}
		}
		answer.push_back(L[LX][LY]+1);
	}
	for (int variable = 0;variable < kurikaeshi;++variable) {
		cout << answer[variable] << endl;
	}
}

Compiler output:
a.cc:2:9: fatal error: vector>: No such file or directory
    2 | #include<vector>b
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>b
using namespace std;
int main()
{
	int kurikaeshi;
	vector<int> answer;
	cin >> kurikaeshi;
	for (int variable = 0;variable < kurikaeshi;++variable) {
		char X[1024], Y[1024];
		int LX = 0, LY = 0;
		vector<vector<int>> L;
		cin >> X >> Y;
		for (int i = 0;X[i] != 0;++i) LX += 1;
		for (int j = 0;Y[j] != 0;++j) LY += 1;
		L.resize(LX+1);
		for (int k = 0;k < LX + 1;++k) L[k].resize(LY+1);
		for (int i = 0;i<LX+1;++i) {
			for (int j = 0;j<LY+1;++j) {
				if (i == 0 || j == 0) {
					L[i][j] = 0;
				}
				else if (X[i-1] == Y[j-1]) {
					L[i][j] = L[i][j-1] + 1;
				}
				else {
					L[i][j] = L[i-1][j] > L[i][j-1] ? L[i-1][j] : L[i][j-1];
				}
			}
		}
		answer.push_back(L[LX][LY]);
	}
	for (int variable = 0;variable < kurikaeshi;++variable) {
		cout << answer[variable] << endl;
	}
}

Compiler output:
a.cc:2:9: fatal error: vector>: No such file or directory
    2 | #include<vector>b
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <string>

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

using namespace std;
int dp[1001][1001];
//?????????????????????
int n;
string x,y;
void solve(){
	cin >> n;
	REP(j,n){
	cin >> x >> y;
	memset(dp,0,1001*1001);
	int xn = x.size();
	int yn = y.size();
	REP(jj,xn+1){
		 REP(ii,yn+1){
			 if(jj <= 0 || ii <= 0){
				 dp[jj][ii] = 0 ;
			 }
			 else if(x[jj-1]==y[ii-1]) {
				 dp[jj][ii] = 1 + dp[jj-1][ii-1];
			 }
			 else{
				 dp[jj][ii] = max ( dp[jj-1][ii], dp[jj][ii-1] );
		   }
			 //cout << '('<<ii<<','<<jj<<')'<<dp[jj][ii]<<endl;
		 }

	}
	cout << dp[xn][yn]<<endl;
	}


}


int main(){
solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:22:9: error: 'memset' was not declared in this scope
   22 |         memset(dp,0,1001*1001);
      |         ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <math.h>
  +++ |+#include <cstring>
    6 | #include <string>
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int n, xl, yl, dp[1003][1003]; char x[1003], y[1003];
int main() {
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		scanf("%s", x); xl = strlen(x);
		scanf("%s", y); yl = strlen(y);
		memset(dp, 0, sizeof(dp));
		for(int i = 1; i <= xl; i++) {
			for(int j = 1; j <= yl; j++) {
				if(x[i - 1] == y[i - 1]) dp[i][j] = dp[i - 1][j - 1] + 1;
				else dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
			}
		}
		printf("%d\n", dp[xl][yl]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:38: error: 'strlen' was not declared in this scope
    8 |                 scanf("%s", x); xl = strlen(x);
      |                                      ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
a.cc:10:17: error: 'memset' was not declared in this scope
   10 |                 memset(dp, 0, sizeof(dp));
      |                 ^~~~~~
a.cc:10:17: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <tuple>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
#include <random>
#include <cstdlib>
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#define Loop1(i, n) for(int i = 1; i <= (int)n; i++)
#define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--)
#define Loopr1(i, n) for(int i = (int)n; i >= 1; i--)
using namespace std;
typedef long long int ll;
 
string x, y;
int memo[1005][1005];
 
int dp(int a, int b) {
    if (memo[a][b] != INT_MIN) return memo[a][b];
    if (a == 0 || b == 0) memo[a][b] = 0;
    else if (x[a - 1] == y[b - 1]) {
        memo[a][b] = dp(a - 1, b - 1) + 1;
    }
    else {
        memo[a][b] = max(dp(a - 1, b), dp(a, b - 1));
    }
    return memo[a][b];
}
 
int main() {
    int q;
    cin >> q;
    Loop(i, q) {
        cin >> x >> y;
        Loop(j, x.size()+1) {
            Loop(k, y.size()+1) {
                memo[j][k] = INT_MIN;
            }
        }
        cout << dp(x.size(), y.size()) << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int dp(int, int)':
a.cc:28:23: error: 'INT_MIN' was not declared in this scope
   28 |     if (memo[a][b] != INT_MIN) return memo[a][b];
      |                       ^~~~~~~
a.cc:17:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   16 | #include <cstdlib>
  +++ |+#include <climits>
   17 | #define Loop(i, n) for(int i = 0; i < (int)n; i++)
a.cc: In function 'int main()':
a.cc:46:30: error: 'INT_MIN' was not declared in this scope
   46 |                 memo[j][k] = INT_MIN;
      |                              ^~~~~~~
a.cc:46:30: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

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

int dp[1001][1001];
int q;

void solve(){
  char x[1001],y[1001];
  scanf("%s %s",x,y);
  int lx = strlen(x);
  int ly = strlen(y);
  for(int i=0;i<=lx;i++){
    for(int j=0;j<=ly;j++){
      if(i==0||j==0) dp[i][j] = 0;
      else if(x[i]==y[j]) dp[i][j] = dp[i-1][j-1]+1;
      else dp[i][j] = max(dp[i][j-1],dp[i-1][j]);
    }
  }
  printf("%d\n",dp[lx][ly]);
  return;
}


int main(){
  scanf("%d",&q);
  for(int i=0;i<q;i++) solve();
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:11:12: error: 'strlen' was not declared in this scope
   11 |   int lx = strlen(x);
      |            ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <iostream>

using namespace std;

/**
 *  lcs(m,n) = 
 *  if x[m] == y[n] lcs[m-1,n-1]+1
 *  max(lcs[m-1,n],lcs[m,n-1])
 *
 */

string x, y;

const int q = 150;

int c[q][q];

int lcs(int m, int n)
{
	if (m == -1 || n== -1) return 0;
	if (x[m] == y[n]) return lcs(m-1,n-1) + 1;
	int & cc = c[m][n];
	if (cc != -1) return cc;
	int xx = lcs(m-1,n);
	int yy = lcs(m,n-1);
	cc = xx > yy ? xx : yy;
	return cc;
}

int main()
{
	int n = 0;
	x.resize(q);
	y.resize(q);
	memset(c, -1, sizeof(c));
	cin >> n; 
	for (int i=0;i<n;i++)
	{
		cin >> x;
		cin >> y;
		cout << lcs(x.size()-1, y.size()-1) << endl;
		x.clear();
		y.clear();
	}
}

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

#include <iostream>
#include <string>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define clr(a,v) memset((a),(v),sizeof(a))

int q;
int dp[1000][1000];
std::string s, t;

int rec( int i, int j )
{
  int &ret = dp[i][j];

  if( ~ret )
    return ret;

  if( i == s.size() || j == t.size() )
    return 0;

  ret = 0;

  if( s[i] == t[j] )
    ret = std::max( ret, rec( i+1, j+1 )+1 );

  ret = std::max( { ret, rec( i+1, j ), rec( i, j+1 ) } );

  return ret;
}

int main()
{
  scanf( "%d", &q );
  while( q-- )
  {
    std::cin >> s >> t;

    clr( dp, -1 );

    std::cout << rec( 0, 0 ) << std::endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int rec(int, int)':
a.cc:26:17: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   26 |   ret = std::max( { ret, rec( i+1, j ), rec( i, j+1 ) } );
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
a.cc: In function 'int main()':
a.cc:5:18: error: 'memset' was not declared in this scope
    5 | #define clr(a,v) memset((a),(v),sizeof(a))
      |                  ^~~~~~
a.cc:38:5: note: in expansion of macro 'clr'
   38 |     clr( dp, -1 );
      |     ^~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include <iostream>
#include <string>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define clr(a,v) memset((a),(v),sizeof(a))

int q;
int dp[1000][1000];
std::string s, t;

int rec( int i, int j )
{
  int &ret = dp[i][j];

  if( ~ret )
    return ret;

  if( i == s.size() || j == t.size() )
    return 0;

  ret = 0;

  if( s[i] == t[j] )
    ret = std::max( ret, rec( i+1, j+1 )+1 );

  ret = std::max( ret, std::max( rec( i+1, j ), rec( i, j+1 ) ) );

  return ret;
}

int main()
{
  scanf( "%d", &q );
  while( q-- )
  {
    std::cin >> s >> t;

    clr( dp, -1 );

    std::cout << rec( 0, 0 ) << std::endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: 'memset' was not declared in this scope
    5 | #define clr(a,v) memset((a),(v),sizeof(a))
      |                  ^~~~~~
a.cc:38:5: note: in expansion of macro 'clr'
   38 |     clr( dp, -1 );
      |     ^~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include<iostream>
#include<string>
using namespace std;
int lcs[1001][1001];
/*int lcs(string a,string b)
{
    if(a.length()<=0||b.length()<=0)
    {
        return 0;
    }
    else if(a[a.length()-1]==b[b.length()-1])
    {
        return 1+lcs(a.substr(0,a.length()-1),b.substr(0,b.length()-1));
    }
    else
    {
        return max(lcs(a.substr(0,a.length()),b.substr(0,b.length()-1)),lcs(a.substr(0,a.length()-1),b.substr(0,b.length())));
    }
};*/
int main()
{
    int num;
    cin>>num;
    for(int l=0;l<num;l++)
    {

        for(int i=0;i<1001;i++)
            for(int j=0;j<1001;j++)
                lcs[i][j]=0;
        string a,b;
        cin>>a>>b;
        //cout<<lcs(a,b)<<endl;
        for(int i=0;i<a.length()+1;i++)
        {
            for(int j=0;j<b.length()+1;j++)
            {
                if(i==0||j==0)
                {
                    lcs[i][j]=0;
                }
                else if(a[i-1]==b[j-1])
                {
                    lcs[i][j]=lcs[i-1][j-1]+1;
                }
                else
                {
					if(lcs[i][j-1]>lcs[i-1][j])
						lcs[i][j]=lcs[i][j-1];
					else
						lcs[i][j]=lcs[i-1][j];
                }
            }
        }
        cout<<lcs[a.length()][b.length()]<<endl;
    }
}

}

Compiler output:
a.cc:58:1: error: expected declaration before '}' token
   58 | }
      | ^
Language: C++

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

const int MAX = 1000;
static int n, m;
static char S[150][MAX], T[150][MAX];
static int ans[150][MAX];
void solve(int in)
{
	int count_max = 0;
	for (int i = n - 1; i >= 0; i--) {
		count_max = 0;
		for (int j = n - 1; j >= 0; j--) {
			int count = 0;
			int tem_i = i, tem_j = j;
			//?????´??????????????????????????????????????´????????´????????¢?´¢??????
			if (S[in][tem_i] == T[in][tem_j] && S[in][tem_i + 1] == T[in][tem_j + 1] && tem_i + 1 < n && tem_j + 1 < m)
				break;
			while (S[in][tem_i] == T[in][tem_j]&& tem_i>=0 && tem_j>=0 ) {
				count++;
				tem_i--;
				tem_j--;
			}
			if (count_max < count) {
				count_max = count;
			}
		}
		ans[in][i] = count_max;
		//???????????§??§i??????????????§?????¨??????????±???????.
	}
}
int main()
{
	int q;
	cin >> q;
	for (int i = 0; i < q; i++) {
		cin >> S[i];
		cin >> T[i];
		n = strlen(S[i]);
		m = strlen(T[i]);
		solve(i);
	}

	for (int i = 0; i < q; i++)
	cout << *max_element(&ans[i][0], &ans[i][n]) << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:21: error: 'strlen' was not declared in this scope
   42 |                 n = strlen(S[i]);
      |                     ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | #include<string>
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<set>
#include<algorithm>
#define ll long long
using namespace std;

int dp[1001][1001];
int main() {
	int b;
	scanf("%d", &b);
	char e[1001];
	char f[1001];
	for (int c = 0; c < b; c++) {
		scanf("%s%s", e, f);
		for (int g = 0; g <= strlen(e); g++) {
			for (int h = 0; h <= strlen(f); h++) {
				dp[g][h] = 0;
			}
		}
		for (int g = 1; g <= strlen(e); g++) {
			for (int h = 1; h <= strlen(f); h++) {
				if (e[g] == f[h]) {
					dp[g][h] = dp[g - 1][h - 1] + 1;
				}
				else {
					dp[g][h] = max(dp[g][h - 1], dp[g - 1][h]);
				}
			}
		}
		printf("%d\n", dp[strlen(e)][strlen(f)]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:38: error: 'strlen' was not declared in this scope
   18 |                 for (int g = 0; g <= strlen(e); g++) {
      |                                      ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<algorithm>
  +++ |+#include <cstring>
    7 | #define ll long long
a.cc:23:38: error: 'strlen' was not declared in this scope
   23 |                 for (int g = 1; g <= strlen(e); g++) {
      |                                      ^~~~~~
a.cc:23:38: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:33:35: error: 'strlen' was not declared in this scope
   33 |                 printf("%d\n", dp[strlen(e)][strlen(f)]);
      |                                   ^~~~~~
a.cc:33:35: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<set>
#include<algorithm>
#define ll long long
using namespace std;

int dp[1001][1001];
int main() {
	int b;
	scanf("%d", &b);
	char e[1001];
	char f[1001];
	for (int c = 0; c < b; c++) {
		scanf("%s%s", e, f);
		for (int g = 0; g <= strlen(e); g++) {
			for (int h = 0; h <= strlen(f); h++) {
				dp[g][h] = 0;
			}
		}
		for (int g = 0; g < strlen(e); g++) {
			for (int h = 0; h < strlen(f); h++) {
				if (e[g] == f[h]) {
					dp[g+1][h+1] = dp[g][h] + 1;
				}
				else {
					dp[g+1][h+1] = max(dp[g][h + 1], dp[g + 1][h]);
				}
			}
		}
		printf("%d\n", dp[strlen(e)][strlen(f)]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:38: error: 'strlen' was not declared in this scope
   18 |                 for (int g = 0; g <= strlen(e); g++) {
      |                                      ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<algorithm>
  +++ |+#include <cstring>
    7 | #define ll long long
a.cc:23:37: error: 'strlen' was not declared in this scope
   23 |                 for (int g = 0; g < strlen(e); g++) {
      |                                     ^~~~~~
a.cc:23:37: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:33:35: error: 'strlen' was not declared in this scope
   33 |                 printf("%d\n", dp[strlen(e)][strlen(f)]);
      |                                   ^~~~~~
a.cc:33:35: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N=1000;

int lcs(string X,string Y){
  int c[N+1][N+1];
  int m=X.size();
  int n=Y.size();
  int i,j;
  int maxl=0;
  X=' '+X;
  Y=' '+Y;
 
  for(i=1;i<=m;i++) c[i][0]=0;
  for(j=1;j<=n;j++) c[0]c[j]=0;

  for(i=1;i<=m;i++){
    for(j=1;j<=n;j++){
      if(X[i]==Y[j]){
        c[i][j]=c[i-1][j-1]+1;
      }else{
        c[i][j]=max(c[i-1][j],c[i][j-1]);
      }
      maxl=max(maxl,c[i][j]);
    }
  }
  return maxl;
}

int main(){
  string s1,s2;
  int n; cin>>n;
  for(i=0;i<n;i++){
    cin>>s1>>s2;
    cout<<lcs(s1,s2)<<enl;
  }
  return0;
}

Compiler output:
a.cc: In function 'int lcs(std::string, std::string)':
a.cc:17:25: error: expected ';' before 'c'
   17 |   for(j=1;j<=n;j++) c[0]c[j]=0;
      |                         ^
      |                         ;
a.cc: In function 'int main()':
a.cc:35:7: error: 'i' was not declared in this scope
   35 |   for(i=0;i<n;i++){
      |       ^
a.cc:37:23: error: 'enl' was not declared in this scope
   37 |     cout<<lcs(s1,s2)<<enl;
      |                       ^~~
a.cc:39:3: error: 'return0' was not declared in this scope
   39 |   return0;
      |   ^~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N=1000;

int lcs(string X,string Y){
  int c[N+1][N+1];
  int m=X.size();
  int n=Y.size();
  int i,j;
  int maxl=0;
  X=' '+X;
  Y=' '+Y;
 
  for(i=1;i<=m;i++) c[i][0]=0;
  for(j=1;j<=n;j++) c[0]c[j]=0;

  for(i=1;i<=m;i++){
    for(j=1;j<=n;j++){
      if(X[i]==Y[j]){
        c[i][j]=c[i-1][j-1]+1;
      }else{
        c[i][j]=max(c[i-1][j],c[i][j-1]);
      }
      maxl=max(maxl,c[i][j]);
    }
  }
  return maxl;
}

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

Compiler output:
a.cc: In function 'int lcs(std::string, std::string)':
a.cc:17:25: error: expected ';' before 'c'
   17 |   for(j=1;j<=n;j++) c[0]c[j]=0;
      |                         ^
      |                         ;
a.cc: In function 'int main()':
a.cc:35:7: error: 'i' was not declared in this scope
   35 |   for(i=0;i<n;i++){
      |       ^
a.cc:37:23: error: 'enl' was not declared in this scope
   37 |     cout<<lcs(s1,s2)<<enl;
      |                       ^~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N=1000;

int lcs(string X,string Y){
  int c[N+1][N+1];
  int m=X.size();
  int n=Y.size();
  int i,j;
  int maxl=0;
  X=' '+X;
  Y=' '+Y;
 
  for(i=1;i<=m;i++) c[i][0]=0;
  for(j=1;j<=n;j++) c[0]c[j]=0;

  for(i=1;i<=m;i++){
    for(j=1;j<=n;j++){
      if(X[i]==Y[j]){
        c[i][j]=c[i-1][j-1]+1;
      }else{
        c[i][j]=max(c[i-1][j],c[i][j-1]);
      }
      maxl=max(maxl,c[i][j]);
    }
  }
  return maxl;
}

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

Compiler output:
a.cc: In function 'int lcs(std::string, std::string)':
a.cc:17:25: error: expected ';' before 'c'
   17 |   for(j=1;j<=n;j++) c[0]c[j]=0;
      |                         ^
      |                         ;
a.cc: In function 'int main()':
a.cc:37:23: error: 'enl' was not declared in this scope
   37 |     cout<<lcs(s1,s2)<<enl;
      |                       ^~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N=1000;

int lcs(string X,string Y){
  int c[N+1][N+1];
  int m=X.size();
  int n=Y.size();
  int i,j;
  int maxl=0;
  X=' '+X;
  Y=' '+Y;
 
  for(i=1;i<=m;i++) c[i][0]=0;
  for(j=1;j<=n;j++) c[0]c[j]=0;

  for(i=1;i<=m;i++){
    for(j=1;j<=n;j++){
      if(X[i]==Y[j]){
        c[i][j]=c[i-1][j-1]+1;
      }else{
        c[i][j]=max(c[i-1][j],c[i][j-1]);
      }
      maxl=max(maxl,c[i][j]);
    }
  }
  return maxl;
}

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

Compiler output:
a.cc: In function 'int lcs(std::string, std::string)':
a.cc:17:25: error: expected ';' before 'c'
   17 |   for(j=1;j<=n;j++) c[0]c[j]=0;
      |                         ^
      |                         ;
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N=1000;

int lcs(string X,string Y){
  int c[N+1][N+1];
  int m=X.size();
  int n=Y.size();
  int i,j;
  int maxl=0;
  X= ' ' + X;
  Y= ' ' + Y;
 
  for(i=1;i<=m;i++) c[i]c[0]=0;
  for(j=1;j<=n;j++) c[0]c[j]=0;

  for(i=1;i<=m;i++){
    for(j=1;j<=n;j++){
      if(X[i]==Y[j]){
        c[i][j]=c[i-1][j-1]+1;
      }else{
        c[i][j]=max(c[i-1][j],c[i][j-1]);
      }
      maxl=max(maxl,c[i][j]);
    }
  }
  return maxl;
}

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

Compiler output:
a.cc: In function 'int lcs(std::string, std::string)':
a.cc:16:25: error: expected ';' before 'c'
   16 |   for(i=1;i<=m;i++) c[i]c[0]=0;
      |                         ^
      |                         ;
a.cc:17:25: error: expected ';' before 'c'
   17 |   for(j=1;j<=n;j++) c[0]c[j]=0;
      |                         ^
      |                         ;
Language: C++

#include <iostream>
#include <string>
#include <algprithm>
using namespace std;
static const int N = 1000;

int lcs ( string X, string Y ) {
	int c[N + 1][N + 1];
	int m = X.size();
	int n = Y.size();
	int maxl = 0;
	X = ' ' + X;
	Y = ' ' + Y;	
	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] = max(c[i-1][j], c[i][j-1]);
			}
			maxl = max(maxl, c[i][j]);
		}
	}
	return maxl;
}

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

Compiler output:
a.cc:3:10: fatal error: algprithm: No such file or directory
    3 | #include <algprithm>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <cstdlib>

using namespace std;


int main(void) {

	char X[100], Y[100];
	char *S;
	int q;

	cin >> q;

	for (int i = 0;i < q;i++) {
		cin >> X;
		cin >> Y;
		S = strstr(X, Y);
		cout << strlen(S) << endl;
	}
		return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:21: error: 'strstr' was not declared in this scope
   26 |                 S = strstr(X, Y);
      |                     ^~~~~~
a.cc:11:1: note: 'strstr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <cstdlib>
  +++ |+#include <cstring>
   11 | 
a.cc:27:25: error: 'strlen' was not declared in this scope
   27 |                 cout << strlen(S) << endl;
      |                         ^~~~~~
a.cc:27:25: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <stdio.h>

int t[1001][1001];
 
int main(){
  char X[1000],Y[1000];
  int i, j, n, x, y, k;
 
  scanf("%d",&n);
 
  for(k=0; k<n; k++){
    scanf("%s%s",X+1,Y+1);
    x=strlen(X+1);
    y=strlen(Y+1);
 
    for(i=1; i<=x; i++)
      for(j=0; j<=y;j++)
    t[i][j]=0;
 
    for(i=1;i<=x;i++){
      for(j=1;j<=y;j++){
    if(X[i] == Y[j])  t[i][j]=t[i-1][j-1]+1;
    else if(t[i-1][j]>=t[i][j-1]) t[i][j]=t[i-1][j];
    else t[i][j]=t[i][j-1];
      }
    }
    printf("%d\n", t[i-1][j-1]);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'strlen' was not declared in this scope
   13 |     x=strlen(X+1);
      |       ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <stdio.h>
  +++ |+#include <cstring>
    2 |
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
static const int N = 1000;
int lcs(string X, string Y) {
  int c[N + 1][N + 1];
  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 j = 1; i <= n; j++) 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] = max(c[i - 1][j], c[i][j - 1]);
      }
      maxl = max(maxl, c[i][j]);
    }
  }
  return maxl;
}
int main(){
  string s1, s2;
  int n; cin >> n;
  for ( int i = 0; i < n; i++ ){
    cin >> s1 >>s2;
    cout << lcs(s1, s2) << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int lcs(std::string, std::string)':
a.cc:14:20: error: 'i' was not declared in this scope
   14 |   for ( int j = 1; i <= n; j++) c[0][j] = 0;
      |                    ^
Language: C++

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

int main(){
   char str_s[128], str_p[128];
   int a[100]=0;
   int i, j, c, h, n, m;
   scanf("%d",n);
   for(i=0;i < n;i++){
      scanf("%s",str_s);
      scanf("%s",str_p);
      n=strlen(str_s);
      m=strlen(str_p);
      c=0;
      h=0;
      for(i=0;i < n;i++){
         for(j=h;j < m;j++){
            if(str_s[i] ==str_p[j]){
               h=j+1;
               c++;
               break;
            }
         }
      }
      printf("%d\n, c");
   }

   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: array must be initialized with a brace-enclosed initializer
    6 |    int a[100]=0;
      |               ^
Language: C++



#include<iostream>
#include<string>
#include<algorithm>
#define N 1000
using namespace std;
int lcs(string X, string Y) {
  int c[N + 1][N + 1];
  int m = X.size();
  int n = Y.size();
  for ( int i = 1; i <= m; i++ ) c[i][0] = 0;
  for ( int j = 1; j <= n; j++ ) c[0][j] = 0;
  for ( int i = 1; i <= m; i++ ){
    for ( int j = 1; j <= n; j++ ){
      if ( X[i - 1] == Y[j - 1] ){
        c[i][j] = c[i - 1][j - 1] + 1;
      } else {
        c[i][j] = max(c[i][j - 1], c[i - 1][j]);
      }
    }
  }
  return c[m][n]
}
int main(){
  int n;
  cin >> n;
  for ( int i = 0; i < n; ++i ){
  string s1, s2;
    cin >> s1 >> s2;
    cout << lcs(s1, s2) << endl;
  }
  return 0;
}


 

Compiler output:
a.cc: In function 'int lcs(std::string, std::string)':
a.cc:23:17: error: expected ';' before '}' token
   23 |   return c[m][n]
      |                 ^
      |                 ;
   24 | }
      | ~
Language: C++

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

using namespace std;

static const int N = 1000;

int lcs(string X, string Y){
	int c[N + 1][N + 1];
	int m = X.xize();
	int n = Y.size();
	int maxl = 0;
	X = ' ' + X;
	Y = ' ' + Y;
	
	for(int i = 1; i <= m; i++)
	c[i][0] = 0;
	
	for(int j = 1; j <= n; j++)
	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] = max(c[i - 1][j], c[i][j - 1]);
			}
			maxl = max(maxl,c[i][j]);
		}
	}
	
	return maxl;
}


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

Compiler output:
a.cc: In function 'int lcs(std::string, std::string)':
a.cc:11:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'xize'; did you mean 'size'?
   11 |         int m = X.xize();
      |                   ^~~~
      |                   size
a.cc: In function 'int main()':
a.cc:44:36: error: 'end1' was not declared in this scope
   44 |             cout << lcs(s1, s2) << end1;
      |                                    ^~~~
Language: C++

#include<stdio.h>
#include<string>
#include<algorithm>
using namespase std;
static const int N = 1000;

int lcs(string X, string Y){
  int c[N + 1][N + 1]{
  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 j = 1; j <= n; j++) 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] = max(c[i -1][j], c[i][j = 1]);
       }
       maxl = max(maxl, c[i][j];
     }
  }

  return maxl;
}


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

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'namespase'
    4 | using namespase std;
      |       ^~~~~~~~~
a.cc:7:9: error: 'string' was not declared in this scope
    7 | int lcs(string X, string Y){
      |         ^~~~~~
a.cc:7:9: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:19: error: 'string' was not declared in this scope
    7 | int lcs(string X, string Y){
      |                   ^~~~~~
a.cc:7:19: note: suggested alternatives:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:27: error: expression list treated as compound expression in initializer [-fpermissive]
    7 | int lcs(string X, string Y){
      |                           ^
Language: C++

#include<stdio.h>
#include<string.h>
#define MAX 1001
??
int LCSLength(char [], char []);
??
int main()
{
????int i, q, Z[MAX];
????char X[MAX], Y[MAX];
??
????scanf("%d", &q);
????for(i=0; i<q; i++)
????????{
????????????scanf("%s", X);
????????????scanf("%s", Y);
????????????Z[i] = LCSLength(X, Y);
????????}
??
????for(i=0; i<q; i++)
????????{
????????????printf("%d\n", Z[i]);
????????}
????
????return 0;
}
??
int LCSLength(char X[], char Y[])
{
????int i, j, c[MAX][MAX];
????int m = strlen(X);
????int n = strlen(Y);
??
????for(i=1; i<=m; i++) c[i][0] = 0;
????for(j=0; j<=n; j++) c[0][j] = 0;
??
????for(i=1; i<=m; i++)
????????{
????????????for(j=1; j<=n; j++)
????????{
????????????if(X[i-1] == Y[j-1]) c[i][j] = c[i-1][j-1] + 1;
????????????else if(c[i-1][j-1] >= c[i][j-1]) c[i][j] = c[i-1][j];
????????????else c[i][j] = c[i][j-1];
????????}
????????}
??????
????return c[m][n];
}

Compiler output:
a.cc:4:1: error: expected unqualified-id before '?' token
    4 | ??
      | ^
a.cc:6:1: error: expected unqualified-id before '?' token
    6 | ??
      | ^
a.cc:27:1: error: expected unqualified-id before '?' token
   27 | ??
      | ^
Language: C++

#include<stdio.h>
??
int LCS(char x[], char y[]) {
????int xn = 0, yn = 0, flag = 0, i, j, max = 0;
????int c[1001][1001];
??????
????while (flag == 0)
????{
????????if (x[xn] != '\0')
????????{
????????????xn++;
????????}
????????else
????????{
????????????flag = 1;
????????}
????}
??????
????flag = 0;
??????
????while (flag == 0)
????{
????????if (y[yn] != '\0')
????????{
????????????yn++;
????????}
????????else
????????{
????????????flag = 1;
????????}
????}
????for (i = 1; i < xn + 1; i++) c[i][0] = 0;
????for (j = 1; j < yn + 1; j++) c[0][j] = 0;
??????
????for (i = 1; i < xn + 1; i++)
????{
????????for (j = 1; j < yn + 1; j++)
????????{
????????????if (x[i - 1] == y[j - 1])
????????????{
????????????????c[i][j] = c[i - 1][j - 1] + 1;
????????????}
????????????else if (c[i - 1][j] >= c[i][j - 1])
????????????{
????????????????c[i][j] = c[i - 1][j];
????????????}
????????????else
????????????{
????????????????c[i][j] = c[i][j - 1];
????????????}
????????????if (max < c[i][j]) max = c[i][j];
????????}
????}
??????
????return max;
}
??
int main(void) {
????char x[1000], y[1000];
????int q, i;
??????
????scanf("%d", &q);
??????
????for (i = 0; i < q; i++)
????{
????????scanf("%s", x);
????????scanf("%s", y);
????????printf("%d\n", LCS(x, y));
????}
??????
????return 0;
}

Compiler output:
a.cc:2:1: error: expected unqualified-id before '?' token
    2 | ??
      | ^
a.cc:57:1: error: expected unqualified-id before '?' token
   57 | ??
      | ^
Language: C++

#include<stdio.h>
??
int hantei(char x[], char y[]) {
????int xn = 0, yn = 0, flag = 0, i, j, max = 0;
????int c[1001][1001];
??????
????while (flag == 0)
????{
????????if (x[xn] != '\0')
????????{
????????????xn++;
????????}
????????else
????????{
????????????flag = 1;
????????}
????}
??????
????flag = 0;
??????
????while (flag == 0)
????{
????????if (y[yn] != '\0')
????????{
????????????yn++;
????????}
????????else
????????{
????????????flag = 1;
????????}
????}
????for (i = 1; i < xn + 1; i++) c[i][0] = 0;
????for (j = 1; j < yn + 1; j++) c[0][j] = 0;
??????
????for (i = 1; i < xn + 1; i++)
????{
????????for (j = 1; j < yn + 1; j++)
????????{
????????????if (x[i - 1] == y[j - 1])
????????????{
????????????????c[i][j] = c[i - 1][j - 1] + 1;
????????????}
????????????else if (c[i - 1][j] >= c[i][j - 1])
????????????{
????????????????c[i][j] = c[i - 1][j];
????????????}
????????????else
????????????{
????????????????c[i][j] = c[i][j - 1];
????????????}
????????????if (max < c[i][j]) max = c[i][j];
????????}
????}
??????
????return max;
}
??
int main(void) {
????char x[1000], y[1000];
????int q, i;
??????
????scanf("%d", &q);
??????
????for (i = 0; i < q; i++)
????{
????????scanf("%s", x);
????????scanf("%s", y);
????????printf("%d\n", hantei(x, y));
????}
??????
????return 0;
}

Compiler output:
a.cc:2:1: error: expected unqualified-id before '?' token
    2 | ??
      | ^
a.cc:57:1: error: expected unqualified-id before '?' token
   57 | ??
      | ^
Language: C++

#include<stdio.h>
#include<string.h>
????????
int LCS(char *X, char *Y){
????int i,j,m,n,c[1001][1001];
????m = strlen(X);
????n = strlen(Y);
????????????
????for(i=0; i<m; i++){
????????c[i][0] = 0;
????}
????for(j=0; j<n; j++){
????????c[0][j] = 0;
????}
????????
????for(i=1;i<m+1;i++){
????????for(j=1;j<n+1;j++){
????????????if (X[i-1]==Y[j-1]) c[i][j]=c[i-1][j-1]+1;
????????????else if (c[i-1][j]>=c[i][j-1]) c[i][j]=c[i-1][j];
????????????else c[i][j]=c[i][j-1];
????????}
????}
????return c[i-1][j-1];
}
????????
int main(){
????int i, q;
????char X[1001], Y[1001];
????????????
????scanf("%d", &q);
????for(i=0; i<q; i++){
????????scanf("%s", X);
????????scanf("%s", Y);
????????printf("%d\n", LCS(X, Y));
????????
????}
????return 0;
}

Compiler output:
a.cc:3:1: error: expected unqualified-id before '?' token
    3 | ????????
      | ^
a.cc:25:1: error: expected unqualified-id before '?' token
   25 | ????????
      | ^