Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll N=3001;
ll dp[N][N];string a,b;
int main(){
    //Normal lazy string dp would'nt work in this
    //have to use back-pointer compulsorily for this
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    cin>>a>>b;
    for(ll i=1;i<=a.length();i++){
        for(ll j=1;j<=b.length();j++){
            if(a[i-1]==b[j-1]){
                dp[i][j]=1+dp[i-1][j-1];
            }
            else{
                dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
            }       
        }
    }
    string ans;
    ll i=a.length(),j=b.length();
    //cout<<dp[i][j]<<"\n";
    while(i>0 && j>0){
        //cout<<i<<" "<<j<<" "<<dp[i][j]<<"\n";
        if(dp[i][j]==dp[i][j-1]){
            j--;
        }
        else if(dp[i][j]==dp[i-1][j]){
            i--;
        }
        else{
            ans.push_back(a[i-1]);
            i--;
        }
    }

    reverse(ans.begin(),ans.end());
    cout<<ans<<"\n";
    return 0; 
}#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll N=3001;
ll dp[N][N];string a,b;
int main(){
    //Normal lazy string dp would'nt work in this
    //have to use back-pointer compulsorily for this
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    cin>>a>>b;
    for(ll i=1;i<=a.length();i++){
        for(ll j=1;j<=b.length();j++){
            if(a[i-1]==b[j-1]){
                dp[i][j]=1+dp[i-1][j-1];
            }
            else{
                dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
            }       
        }
    }
    string ans;
    ll i=a.length(),j=b.length();
    //cout<<dp[i][j]<<"\n";
    while(i>0 && j>0){
        //cout<<i<<" "<<j<<" "<<dp[i][j]<<"\n";
        if(dp[i][j]==dp[i][j-1]){
            j--;
        }
        else if(dp[i][j]==dp[i-1][j]){
            i--;
        }
        else{
            ans.push_back(a[i-1]);
            i--;
        }
    }

    reverse(ans.begin(),ans.end());
    cout<<ans<<"\n";
    return 0; 
}

Compiler output:
a.cc:41:2: error: stray '#' in program
   41 | }#include<bits/stdc++.h>
      |  ^
a.cc:41:3: error: 'include' does not name a type
   41 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:44:10: error: redefinition of 'const ll N'
   44 | const ll N=3001;
      |          ^
a.cc:4:10: note: 'const ll N' previously defined here
    4 | const ll N=3001;
      |          ^
a.cc:45:4: error: redefinition of 'll dp [3001][3001]'
   45 | ll dp[N][N];string a,b;
      |    ^~
a.cc:5:4: note: 'll dp [3001][3001]' previously declared here
    5 | ll dp[N][N];string a,b;
      |    ^~
a.cc:45:20: error: redefinition of 'std::string a'
   45 | ll dp[N][N];string a,b;
      |                    ^
a.cc:5:20: note: 'std::string a' previously declared here
    5 | ll dp[N][N];string a,b;
      |                    ^
a.cc:45:22: error: redefinition of 'std::string b'
   45 | ll dp[N][N];string a,b;
      |                      ^
a.cc:5:22: note: 'std::string b' previously declared here
    5 | ll dp[N][N];string a,b;
      |                      ^
a.cc:46:5: error: redefinition of 'int main()'
   46 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~