Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <numeric>
#include <ctime>
#include <complex>
#include <bitset>
#include <random>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;

#define int ll
#define double ld
#define loop(i, n) for(int i = 0; i < (int)n; ++i)
#define loop1(i, n) for(int i = 1; i <= (int)n; ++i)
#define F first
#define S second
#define pb push_back
#define pi pair <int, int>
//#define len length()
#define all(x) begin(x), end(x)
#define ti tuple <int, int, int>
#define Point Vect 

const int N = 10000;

bitset<N> ask[6];
map <pi, int> numx;

void calc_dp(string s, string t, int num) {
    bool dp[s.size() + 1][t.size() + 1];
    loop(i, s.size() + 1)
        loop(j, t.size() + 1)
            dp[i][j] = (j == 0);
    loop1(i, s.size())
        loop1(j, t.size()) {
            dp[i][j] = (dp[i - 1][j - 1] && (s[i - 1] == t[j - 1] || s[i - 1] == '?' || t[j - 1] == '?'));
            if (dp[i][j] && j == t.size()) 
                ask[num][i - j] = 1;
        }
    for (int i = t.size(); i >= 0; --i)
        if (dp[s.size()][i]) 
            ask[num][s.size() - i] = 1;
    for (int i = s.size(); i < N; ++i)
        ask[num][i] = 1;
}

void solve() {
    string s[3];
    cin >> s[0] >> s[1] >> s[2];
    int ans = s[0].size() + s[1].size() + s[2].size(), cnt = 0;
    loop(a, 3)
        loop(b, 3) {
            if (a == b) continue;
            numx[{a, b}] = cnt;
            calc_dp(s[a], s[b], cnt++);
            //loop(i, 4) cout << ask[cnt - 1][i];
            //cout << "\n";
        }
    loop(a, 3)
        loop(b, 3)
            loop(c, 3) {
                if (a == b || a == c || b == c) continue;
                loop(i, s[a].size() + 1)
                    loop(j, s[b].size() + 1)
                        if (ask[numx[{a, b}]][i] && ask[numx[{b, c}]][j] && ask[numx[{a, c}]][i + j])
                            ans = min(ans, i + j + s[c].size());    
            }
    cout << max({ans, (int)s[0].size(), (int)s[1].size(), (int)s[2].size()});
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:83:38: error: no matching function for call to 'min(ll&, long long unsigned int)'
   83 |                             ans = min(ans, i + j + s[c].size());
      |                                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:83:38: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   83 |                             ans = min(ans, i + j + s[c].size());
      |                                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:83:38: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   83 |                             ans = min(ans, i + j + s[c].size());
      |                                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~