Language: C++

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#define    boost        ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define    nl           "\n"
#define    ll           long long
#define    pb           push_back
#define    mpr          make_pair
#define    fr(i,a,n)    for(ll i=a;i<n;++i)
#define    fr0(i,n)     for(ll i=0;i<n;++i)
#define    pii          pair<int, int>
#define    FO           find_by_order
#define    OK           order_of_key
#define    mem(a)       memset(a,0,sizeof(a))
#define    ff           first
#define    ss           second


typedef tree <
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update >
set_t;


void fio()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}


template<typename T> void TIME(T start, T end)
{
#ifndef ONLINE_JUDGE
	double time_taken =  chrono::duration_cast<chrono::nanoseconds>(end - start).count();
	time_taken *= 1e-9;
	cout << "\nExecuted in: " << fixed
	     << time_taken << setprecision(9);
	cout << " sec";
#endif
}

///----------------------------- | START | --------------------------------------///

/*
	LCS Problem
https://atcoder.jp/contests/dp/tasks/dp_f
*/

int dp[m + 5][n + 5];
	char path[m + 5][n + 5];
void solve()
{
	string s, t;
	cin >> s >> t;
	int m = s.size(), n = t.size();
	fr(i, 1, m + 1) fr(j, 1, n + 1)
	{
		if (s[i - 1] == t[j - 1])
		{
			dp[i][j] = 1 + dp[i - 1][j - 1];
			path[i][j] = 'x';
		}

		else
		{
			dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
			if (dp[i][j] == dp[i - 1][j])
				path[i][j] = 'd';
			else path[i][j] = 'l';
		}
	}
	string ans;
	int i = m, j = n;
	while (i != 0 && j != 0)
	{
		if (path[i][j] == 'x')
		{
			ans.pb(s[i - 1]);
			i--, j--;
		}
		else if (path[i][j] == 'd')	i--;
		else j--;
	}

	reverse(ans.begin(), ans.end());
	cout << ans << nl;
}




int32_t main()
{
	auto start = chrono::high_resolution_clock::now();
	boost;
	fio();
	int t;
	t = 1;
	//cin >> t;
	while (t--) solve();
	auto end = chrono::high_resolution_clock::now();
	TIME(start, end);
	return 0;
}




Compiler output:
a.cc:63:8: error: 'm' was not declared in this scope; did you mean 'tm'?
   63 | int dp[m + 5][n + 5];
      |        ^
      |        tm
a.cc:63:15: error: 'n' was not declared in this scope; did you mean 'yn'?
   63 | int dp[m + 5][n + 5];
      |               ^
      |               yn
a.cc:64:19: error: 'm' was not declared in this scope; did you mean 'tm'?
   64 |         char path[m + 5][n + 5];
      |                   ^
      |                   tm
a.cc:64:26: error: 'n' was not declared in this scope; did you mean 'yn'?
   64 |         char path[m + 5][n + 5];
      |                          ^
      |                          yn
a.cc: In function 'void solve()':
a.cc:74:25: error: 'dp' was not declared in this scope; did you mean 'dup'?
   74 |                         dp[i][j] = 1 + dp[i - 1][j - 1];
      |                         ^~
      |                         dup
a.cc:75:25: error: 'path' was not declared in this scope; did you mean 'std::filesystem::__cxx11::path'?
   75 |                         path[i][j] = 'x';
      |                         ^~~~
      |                         std::filesystem::__cxx11::path
In file included from /usr/include/c++/14/filesystem:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_path.h:293:9: note: 'std::filesystem::__cxx11::path' declared here
  293 |   class path
      |         ^~~~
a.cc:80:25: error: 'dp' was not declared in this scope; did you mean 'dup'?
   80 |                         dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
      |                         ^~
      |                         dup
a.cc:82:33: error: 'path' was not declared in this scope; did you mean 'std::filesystem::__cxx11::path'?
   82 |                                 path[i][j] = 'd';
      |                                 ^~~~
      |                                 std::filesystem::__cxx11::path
/usr/include/c++/14/bits/fs_path.h:293:9: note: 'std::filesystem::__cxx11::path' declared here
  293 |   class path
      |         ^~~~
a.cc:83:30: error: 'path' was not declared in this scope; did you mean 'std::filesystem::__cxx11::path'?
   83 |                         else path[i][j] = 'l';
      |                              ^~~~
      |                              std::filesystem::__cxx11::path
/usr/include/c++/14/bits/fs_path.h:293:9: note: 'std::filesystem::__cxx11::path' declared here
  293 |   class path
      |         ^~~~
a.cc:90:21: error: 'path' was not declared in this scope; did you mean 'std::filesystem::__cxx11::path'?
   90 |                 if (path[i][j] == 'x')
      |                     ^~~~
      |                     std::filesystem::__cxx11::path
/usr/include/c++/14/bits/fs_path.h:293:9: note: 'std::filesystem::__cxx11::path' declared here
  293 |   class path
      |         ^~~~