Language: C++

#pragma GCC optimize "O2"
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <queue>
// for iota, accumulate, partial_sum
// #include <numeric>
// #include <iomanip>
// #include <fstream>
// #include <deque>
// #include <cmath>
// #include <unordered_map>
// #include <utility>
// #include <unordered_set>
// #include <ctime>
// #include <stack>
// #include <bitset>
// #include <random>
// #include <cstring>
// #include <cassert>
// #include <complex>
using namespace std;
typedef unsigned long long int lu;
typedef long long int ll;
typedef long double ld;
#define v vector<ll>
#define vu vector<lu>
#define vvu vector<vector<lu>>
#define vld vector<ld>
#define vs vector<string>
#define pll pair<ll, ll>
#define vpll vector<pair<ll, ll>>
#define puu pair<lu, lu>
#define vpuu vector<pair<lu, lu>>
const lu MOD = 1000000007;
const ld PI = 2 * acos(0.0);
#define round(x, y) ((x + y - 1) / y)
#define ce(x, y) ((x + y - 1) / y)
#define amax(x, y) \
    if (y > x)     \
        x = y;
#define amin(x, y) \
    if (y < x)     \
        x = y;
#define lcm(x, y) ((x) * (y) / __gcd(x, y))
#define sq(x) ((x) * (x))
#define cb(x) ((x) * (x) * (x))

#define all(x) x.begin(), x.end()

v ga(ll n)
{
    v a;
    for (ll i = 0; i < n; i++)
    {
        ll p;
        // scanf("%lld", &p);
        cin >> p;
        a.push_back(p);
    }
    return move(a);
}

vu gau(lu n)
{
    vu a;
    for (lu i = 0; i < n; i++)
    {
        lu p;
        // scanf("%lu", &p);
        cin >> p;
        a.push_back(p);
    }
    return move(a);
}
vs gas(lu n)
{
    vs a;
    for (lu i = 0; i < n; i++)
    {
        string p;
        // scanf("%lu", &p);
        cin >> p;
        a.push_back(p);
    }
    return move(a);
}

template <typename T, typename A>
void pa(vector<T, A> const &a)
{
    for (T p : a)
    {
        // printf("%lu ", a[i]);
        cout << p << " ";
    }
    cout << "\n";
}

void yes()
{
    cout << "YES\n";
}

void no()
{
    cout << "NO\n";
}

void yesno(int f)
{
    if (f)
        yes();
    else
        no();
}

void solve()
{
    string s, t;
    cin >> s >> t;
    lu n, m;
    n = s.size();
    m = t.size();
    s = "-" + s;
    t = "-" + t;
    vector<vector<pair<lu, string>>> lcs(n + 1, vector<pair<lu, string>>(m + 1));
    string p = "";

    lu ma = 0;
    for (lu i = 1; i <= n; i++)
    {
        for (lu j = 1; j <= m; j++)
        {
            if (i == 1 && j == 1)
            {
                if (s[i] == t[j])
                {
                    lcs[i][j] = make_pair(1, s[i]);
                    p = s[i];
                    ma = 1;
                }
                else
                    lcs[i][j] = make_pair(0, "");
            }
            else if (s[i] == t[j])
            {
                lu val = 1 + lcs[i - 1][j - 1].first;
                string s2 = lcs[i - 1][j - 1].second + s[i];
                lcs[i][j] = make_pair(val, s2);
                if (val > ma)
                {
                    p = s2;
                    ma = val;
                }
            }
            else if (i > 1 && j > 1)
            {
                if (lcs[i - 1][j].first > lcs[i][j - 1].first)
                    lcs[i][j] = lcs[i - 1][j];
                else
                    lcs[i][j] = lcs[i][j - 1];
            }
            else if (i == 1)
                lcs[i][j] = lcs[i][j - 1];
            else if (j == 1)
                lcs[i][j] = lcs[i - 1][j];
        }
    }

    for (auto val : lcs)
    {
        for (auto p : val)
        {
            if (p.second != "")
            // cout << p.second << " ";
        }
        // cout << endl;
    }

    cout << p;
}

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

    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:182:9: error: expected primary-expression before '}' token
  182 |         }
      |         ^