Language: C++

include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
using namespace std;
typedef long long ll;
#define MAX 3001

int main()
{
  char s[MAX], t[MAX];
  cin >> s >> t;

  int dp[MAX][MAX];
  memset(dp, 0, sizeof dp);

  const int sn = strlen(s);
  const int tn = strlen(t);

  FOR(i, 0, sn-1) {
    FOR(j, 0, tn-1) {
      if(s[i]==t[j]) dp[i+1][j+1] = dp[i][j] + 1;
      else dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1]);
    }
  }

  vector<char> res;
  int i = sn-1;
  int j = tn-1;
  while( i>=0 && j>=0 ) {
    if( s[i] == t[j] ) {
      res.push_back(s[i]);
      i--; j--;
    }
    else if( dp[i+1][j+1] == dp[i][j+1] ) i--;
    else j--;
  }

  reverse(res.begin(), res.end());
  for(auto it:res) cout << it;
  cout << endl;

}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'cin' was not declared in this scope
   12 |   cin >> s >> t;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | include <bits/stdc++.h>
a.cc:15:3: error: 'memset' was not declared in this scope
   15 |   memset(dp, 0, sizeof dp);
      |   ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | include <bits/stdc++.h>
a.cc:17:18: error: 'strlen' was not declared in this scope
   17 |   const int sn = strlen(s);
      |                  ^~~~~~
a.cc:17:18: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:23:27: error: 'max' was not declared in this scope
   23 |       else dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1]);
      |                           ^~~
a.cc:27:3: error: 'vector' was not declared in this scope
   27 |   vector<char> res;
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | include <bits/stdc++.h>
a.cc:27:10: error: expected primary-expression before 'char'
   27 |   vector<char> res;
      |          ^~~~
a.cc:32:7: error: 'res' was not declared in this scope; did you mean 'rep'?
   32 |       res.push_back(s[i]);
      |       ^~~
      |       rep
a.cc:39:11: error: 'res' was not declared in this scope; did you mean 'rep'?
   39 |   reverse(res.begin(), res.end());
      |           ^~~
      |           rep
a.cc:39:3: error: 'reverse' was not declared in this scope
   39 |   reverse(res.begin(), res.end());
      |   ^~~~~~~
a.cc:40:20: error: 'cout' was not declared in this scope
   40 |   for(auto it:res) cout << it;
      |                    ^~~~
a.cc:40:20: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:41:3: error: 'cout' was not declared in this scope
   41 |   cout << endl;
      |   ^~~~
a.cc:41:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:41:11: error: 'endl' was not declared in this scope
   41 |   cout << endl;
      |           ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | include <bits/stdc++.h>