Language: C++

/* ****TCIITB**** */

#include<bits/stdc++.h>
#define io          ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); 
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
using namespace std;

#define N  100005
std::vector<ll>func1(string a,string b)
{
	ll t1=min(a.length(),b.length());
	ll mx=0;
	ll res=1e18;
	std::vector<ll> mtch;
	rep(i,0,t1+1)
	{
		ll fl=0;
		rep(j,0,i)
		{
			if(a[a.length()+j-i]==b[j] || (a[a.length()+j-i]=='?') || (b[j]=='?') )
				continue;
			else
				fl=1;
		}
		if(!fl)
			{
				mtch.pb(i);
			}
	}
	
	return mtch;
	

}
ll func(string a,string b,string c)
{
	std::vector<ll> m1=func1(a,b);
	std::vector<ll> m2=func1(b,c);
	sort(all(m1));
	sort(all(m2));
	ll res=1e18;
	for(auto i:m1)
	{
		for(auto j:m2)
			res=min(res,a.length()+b.length()+c.length()-i-j);
	}
	return res;
}
int main()
{
	
	io
	string a,b,c;
	cin>>a>>b>>c;
	ll res=func(a,b,c);
	res=min(res,func(a,c,b));
	res=min(res,func(c,a,b));
	res=min(res,func(c,b,a));
	res=min(res,func(b,a,c));
	res=min(res,func(b,c,a));
	cout<<res;
	
}

Compiler output:
a.cc: In function 'long long int func(std::string, std::string, std::string)':
a.cc:60:32: error: no matching function for call to 'min(long long int&, long long unsigned int)'
   60 |                         res=min(res,a.length()+b.length()+c.length()-i-j);
      |                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:3:
/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:60:32: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   60 |                         res=min(res,a.length()+b.length()+c.length()-i-j);
      |                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:
/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:60:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   60 |                         res=min(res,a.length()+b.length()+c.length()-i-j);
      |                             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~