Language: C++

#include <iostream>
#include <assert.h>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <string.h>
#include <cmath>
#include <algorithm>
#include <iomanip>
using namespace std;

const int N = 3005;
const int oo = 1e9 + 5;

string s, t;

template <typename T> void max_self(T &a, T b) {
    a = max(a, b);
}

int main() {
    cin >> s >> t;
    vector<vector<pair<int, pair<int,int>>>> dp(strlen(s) + 1, 
    vector<pair<int, pair<int, int>>>(strlen(t) + 1, make_pair(-oo, make_pair(0, 0))));
    pair<int, pair<int, int> > ans = {0, {0, 0}};
    dp[0][0] = {0, {0, 0}};
    for (int i = 0; i < strlen(s); ++i) {
        for (int j = 0; j < strlen(t); ++j) {
            if (s[i] == t[j]) {
                max_self(dp[i + 1][j + 1], {1 + dp[i][j].first, {i, j}});
            }
            max_self(dp[i + 1][j], make_pair(dp[i][j].first, make_pair(i, j)));
            max_self(dp[i][j + 1], make_pair(dp[i][j].first, make_pair(i, j)));
        }
    }
    for (int i = 0; i <= strlen(s); ++i) {
        for (int j = 0; j <= strlen(t); ++j) {
            max_self(ans, make_pair(dp[i][j].first, make_pair(i, j)));
        }
    }
    pair<int, int> at = ans.second;
    string str = "";
    while(at.first != 0 && at.second != 0) {
        if (dp[at.first][at.second].second == make_pair(at.first - 1, at.second - 1)) {
            assert(s[at.first - 1] == t[at.second - 1]);
            str += s[at.first - 1];
        }
        at = dp[at.first][at.second].second;
    }
    reverse(str.begin(), str.end());
    cout << str << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:56: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   29 |     vector<vector<pair<int, pair<int,int>>>> dp(strlen(s) + 1,
      |                                                        ^
      |                                                        |
      |                                                        std::string {aka std::__cxx11::basic_string<char>}
In file included from a.cc:12:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:30:46: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   30 |     vector<pair<int, pair<int, int>>>(strlen(t) + 1, make_pair(-oo, make_pair(0, 0))));
      |                                              ^
      |                                              |
      |                                              std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:33:32: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   33 |     for (int i = 0; i < strlen(s); ++i) {
      |                                ^
      |                                |
      |                                std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:34:36: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   34 |         for (int j = 0; j < strlen(t); ++j) {
      |                                    ^
      |                                    |
      |                                    std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:42:33: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   42 |     for (int i = 0; i <= strlen(s); ++i) {
      |                                 ^
      |                                 |
      |                                 std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:43:37: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   43 |         for (int j = 0; j <= strlen(t); ++j) {
      |                                     ^
      |                                     |
      |                                     std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~