Problem: 2050E - Three Strings
Language: c++23 

Code 1:
// LonggVuz

#include<bits/stdc++.h>

using namespace std;

// ☞ Kuroba Kaito ☜

#define fod(i, a, b, c) for(int i=a; i<=b; i+=c)

#define fo(i, n) for(int i=1; i<=n; i++)

#define out(x) return cout << x, void()

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

#define len(x) (int)x.size()

#define el '\n'

#define int int64_t



const int mod = 1e9 + 7;

const int oo = 1e16 + 8;

const int mxn = 1e6 + 9;



int dp[2005][2005];



void LonggVuz(){

    string a, b, c; cin >> a >> b >> c;

    int n = len(a), m = len(b);

    a = " " + a; b = " " + b; c = " " + c;

    fo(i, n) dp[i][0] = dp[i - 1][0] + (a[i] != c[i]);

    fo(i, m) dp[0][i] = dp[0][i - 1] + (b[i] != c[i]);

    fo(i, n){

        fo(j, m){

            if(a[i] == b[j]){

                if(c[i + j] == a[i]){

                    dp[i][j] = min(dp[i - 1][j], dp[i][j - 1]);

                }else dp[i][j] = min(dp[i - 1][j], dp[i][j - 1]) + 1;

            }else{

                if(a[i] == c[i + j]){

                    dp[i][j] = min(dp[i - 1][j], dp[i][j - 1] + 1);

                }else if(b[j] == c[i + j]){

                    dp[i][j] = min(dp[i][j - 1], dp[i - 1][j] + 1);

                }else dp[i][j] = min(dp[i - 1][j], dp[i][j - 1]) + 1;

            }

        }

    }

    cout << dp[n][m];

    fo(i, n) fo(j, m) dp[i][j] = oo;

}



signed main(){

    cin.tie(0) -> sync_with_stdio(0);

    

    int tc = 1; cin >> tc;

    while(tc--){

        LonggVuz();

        if(tc) cout << el;

    }

    

    cerr << "Execution Time: " << 0.001 * clock() << "s\n";

}

Code 2:
// LonggVuz

#include<bits/stdc++.h>

using namespace std;

// ☞ Kuroba Kaito ☜

#define fod(i, a, b, c) for(int i=a; i<=b; i+=c)

#define fo(i, n) for(int i=1; i<=n; i++)

#define out(x) return cout << x, void()

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

#define len(x) (int)x.size()

#define el '\n'

#define int int64_t



const int mod = 1e9 + 7;

const int oo = 1e16 + 8;

const int mxn = 1e6 + 9;



int dp[2005][2005];



void LonggVuz(){

    string a, b, c; cin >> a >> b >> c;

    int n = len(a), m = len(b);

    a = " " + a; b = " " + b; c = " " + c;

    fo(i, n) dp[i][0] = dp[i - 1][0] + (a[i] != c[i]);

    fo(i, m) dp[0][i] = dp[0][i - 1] + (b[i] != c[i]);

    fo(i, n){

        fo(j, m){

            if(a[i] == b[j]){

                if(c[i + j] == a[i]){

                    dp[i][j] = min(dp[i - 1][j], dp[i][j - 1]);

                }else dp[i][j] = min(dp[i - 1][j - 1], min(dp[i][j - 1], dp[i - 1][j])) + 1;

            }else{

                if(a[i] == c[i + j]){

                    dp[i][j] = min(dp[i - 1][j], dp[i][j - 1] + 1);

                }else if(b[j] == c[i + j]){

                    dp[i][j] = min(dp[i][j - 1], dp[i - 1][j] + 1);

                }else dp[i][j] = min(dp[i - 1][j], dp[i][j - 1]) + 1;

            }

        }

    }

    cout << dp[n][m];

    fo(i, n) fo(j, m) dp[i][j] = oo;

}



signed main(){

    cin.tie(0) -> sync_with_stdio(0);

    

    int tc = 1; cin >> tc;

    while(tc--){

        LonggVuz();

        if(tc) cout << el;

    }

    

    cerr << "Execution Time: " << 0.001 * clock() << "s\n";

}

Answer: 1