ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 4):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/problemset/problem/2052/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pii;
typedef pair<int, long long> pil;
typedef pair<long long, int> pli;

const int M = 1e9+7;
const int N = 2e6 + 10;
int a[N], b[N];
int l[N], r[N];
char g[110][110];
char mapp[110][110];
bool st[110][110];
int n, m;

void solve() {
	cin >> n;
	set<int> S;
	for(int i = 1;i <= n;i ++) {
		cin >> a[i];
		S.insert(i);
	}
	
	vector<pii> ans;
	
	for(int i = n;i >= 1;i --) {
		for(int j = 1;j < a[i];j ++) {
			if(S.count(j) == 0) continue;
			ans.push_back({a[i], j});
		}
		S.erase(a[i]);
		for(auto t : S) {
			ans.push_back({t, a[i]});
		}
	}
	
	cout << ans.size() << endl;
	for(auto t : ans) {
		cout << t.first << " " << t.second << endl;
	}
}

int main() {
    ios::sync_with_stdio(false);
    int t = 1;
    // cin >> t;
    while(t --) {
        solve();
    }
    return 0;
}



Submission (verdict: Accepted):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/problemset/problem/2052/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pii;
typedef pair<int, long long> pil;
typedef pair<long long, int> pli;

const int M = 1e9+7;
const int N = 2e6 + 10;
int a[N], b[N];
int l[N], r[N];
char g[110][110];
char mapp[110][110];
bool st[110][110];
int n, m;

void solve() {
	cin >> n;
	set<int> S;
	for(int i = 1;i <= n;i ++) {
		cin >> a[i];
		S.insert(i);
	}
	
	vector<pii> ans;
	
	for(int i = n;i >= 1;i --) {
		for(int j = a[i] - 1;j >= 1;j --) {
			if(S.count(j) == 0) continue;
			ans.push_back({a[i], j});
		}
		S.erase(a[i]);
		for(auto t : S) {
			ans.push_back({t, a[i]});
		}
	}
	
	cout << ans.size() << endl;
	for(auto t : ans) {
		cout << t.first << " " << t.second << endl;
	}
}

int main() {
    ios::sync_with_stdio(false);
    int t = 1;
    // cin >> t;
    while(t --) {
        solve();
    }
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 4):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/problemset/problem/2052/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pii;
typedef pair<int, long long> pil;
typedef pair<long long, int> pli;

const int M = 1e9+7;
const int N = 2e6 + 10;
int a[N], b[N];
int l[N], r[N];
char g[110][110];
char mapp[110][110];
bool st[110][110];
int n, m;

void solve() {
	cin >> n;
	for(int i = 1;i <= n;i ++) {
		cin >> a[i];
	}
	
	vector<pii> ans;
	
	for(int i = n;i >= 1;i --) {
		if(a[i] < i) {
			for(int j = a[i] + 1;j <= i;j ++) {
				ans.push_back({j, a[i]});
			}
		} else {
			if(i == 1) break;
			ans.push_back({a[i], a[i - 1]});
			ans.push_back({a[i - 1], a[i]});
		}
	}
	
	cout << ans.size() << endl;
	for(auto t : ans) {
		cout << t.first << " " << t.second << endl;
	}
}

int main() {
    ios::sync_with_stdio(false);
    int t = 1;
    // cin >> t;
    while(t --) {
        solve();
    }
    return 0;
}



Submission (verdict: Wrong answer on test 5):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/problemset/problem/2052/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pii;
typedef pair<int, long long> pil;
typedef pair<long long, int> pli;

const int M = 1e9+7;
const int N = 2e6 + 10;
int a[N], b[N];
int l[N], r[N];
char g[110][110];
char mapp[110][110];
bool st[110][110];
int n, m;

void solve() {
	cin >> n;
	for(int i = 1;i <= n;i ++) {
		cin >> a[i];
	}
	
	vector<pii> ans;
	
	for(int i = n;i >= 1;i --) {
		if(a[i] < i) {
			for(int j = a[i];j < i;j ++) {
				ans.push_back({a[j], a[i]});
			}
		} else {
			if(i == 1) break;
			int idx = -1;
			for(int j = i;j >= 1;j --) {
				if(a[j] < j) {
					idx = j + 1;
					break;
				}
			}
			if(idx == -1) idx = 1;
			vector<pii> tmp;
			int len = i - idx;
			int cnt = 0;
			while(cnt < len) {
				int j = i;
				for(;j > idx + cnt;j --) {
					tmp.push_back({a[j], a[j - 1]});
					ans.push_back({a[j], a[j - 1]});
					swap(a[j], a[j - 1]);
					
				}
				cnt ++;
			}
			reverse(tmp.begin(), tmp.end());
			for(auto t : tmp) {
				ans.push_back({t.second, t.first});
			}
			i = idx;
		}
	}
	
	cout << ans.size() << endl;
	for(auto t : ans) {
		cout << t.first << " " << t.second << endl;
	}
}

int main() {
    ios::sync_with_stdio(false);
    int t = 1;
    // cin >> t;
    while(t --) {
        solve();
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
int a, b;
void fun(int l, int r)
{
    int p = log2(r);
    int N= pow(2, p);
    if(N-1>=l)
    {
        a = N;
        b = N-1;
        cout << a << " " << b <<" "<<b<< endl;
        return;
    }
    else
    {
        fun(l-N, r-N);
    }
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int N;
        int l, r;
        cin >> l >> r;
        fun(l, r);
    }
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
int a, b;
void fun(int l, int r)
{
    int p = log2(r);
    long long N= pow(2, p);
    if(N-1>=l)
    {
        a = N;
        b = N-1;
        cout << a << " " << b <<" "<<b<< endl;
        return;
    }
    else
    {
        fun(l-N, r-N);
    }
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int l, r;
        cin >> l >> r;
        fun(l, r);
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
int a, b, c;
void fun(int l, int r)
{
    int p = log2(r);
    long long N = pow(2, p);
    if (N - 1 >= l)
    {
        a += N;
        b += N - 1;
        if (a + 1 <= r)
        {
            c = a + 1;
            cout << a << " " << b << " " << c << endl;
        }
        else if (b - 1 >= l)
        {
            c = b - 1;
            cout << a << " " << b << " " << c << endl;
        }
        return;
    }
    else
    {
        a += N;
        b += N;
        c += N;
        fun(l - N, r - N);
    }
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        a = b = c = 0;
        int l, r;
        cin >> l >> r;
        fun(l, r);
    }
    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
int a, b, c;
void fun(int l, int r)
{
    int p = log2(r);
    long long N = pow(2, p);
    if (N - 1 >= l)
    {
        a += N;
        b += N - 1;
        if (a + 1 <= r)
        {
            c += N+1;
            cout << a << " " << b << " " << c << endl;
            return;
        }
        else if (b - 1 >= l)
        {
            c += N-2;
            cout << a << " " << b << " " << c << endl;
            return;
        }
        return;
    }
    else
    {
        a += N;
        b += N;
        c += N;
        fun(l - N, r - N);
    }
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        a = b = c = 0;
        int l, r;
        cin >> l >> r;
        fun(l, r);
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
int a, b, c;
void fun(int l, int r)
{
    int p = log2(r);
    long long N = pow(2, p);
    if (N - 1 >= l)
    {
        a += N;
        b += N - 1;
        if (a + 1 <= r)
        {
            c += N+1;
            cout << a << " " << b << " " << c << endl;
            return;
        }
        else if (b - 1 >= l)
        {
            c += N-2;
            cout << a << " " << b << " " << c << endl;
            return;
        }
        return;
    }
    else
    {
        a += N;
        b += N;
        c += N;
        fun(l - N, r - N);
    }
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        a = b = c = 0;
        int l, r;
        cin >> l >> r;
        fun(l, r);
    }
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
 
using i64 = long long;
 
void solve() {
    int l, r;
    std::cin >> l >> r;
    int k = 31 - __builtin_clz(l ^ r);
    int a = l | ((1 << k) - 1), b = a + 1, c = (a == l ? r : l);
    std::cout << a << " " << b << " " << c << "\n";
}
 
signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
 
    int t = 1;
    std::cin >> t;
 
    while (t--) {
        solve();
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
int a, b;
void fun(int l, int r)
{
    int p = log2(r);
    int N= pow(2, p);
    if(N-1>=l)
    {
        a = N;
        b = N-1;
        cout << a << " " << b <<" "<<b<< endl;
        return;
    }
    else
    {
        fun(l-N, r-N);
    }
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int N;
        int l, r;
        cin >> l >> r;
        fun(l, r);
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
int a, b;
void fun(int l, int r)
{
    int p = log2(r);
    long long N= pow(2, p);
    if(N-1>=l)
    {
        a = N;
        b = N-1;
        cout << a << " " << b <<" "<<b<< endl;
        return;
    }
    else
    {
        fun(l-N, r-N);
    }
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int l, r;
        cin >> l >> r;
        fun(l, r);
    }
    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
int a, b, c;
void fun(int l, int r)
{
    int p = log2(r);
    long long N = pow(2, p);
    if (N - 1 >= l)
    {
        a += N;
        b += N - 1;
        if (a + 1 <= r)
        {
            c = a + 1;
            cout << a << " " << b << " " << c << endl;
        }
        else if (b - 1 >= l)
        {
            c = b - 1;
            cout << a << " " << b << " " << c << endl;
        }
        return;
    }
    else
    {
        a += N;
        b += N;
        c += N;
        fun(l - N, r - N);
    }
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        a = b = c = 0;
        int l, r;
        cin >> l >> r;
        fun(l, r);
    }
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define ld long double
#define vii vector<ll>
#define vll vector<ll>
#define vss vector<string>
#define vcc vector<char>
#define vld vector<ld>
#define vbb vector<bool>
#define re register
#define il inline
#define pii pair<ll,ll>
#define pll pair<ll,ll>
#define pcc pair<char,char>
#define mii map<ll,ll>
#define mci map<char,ll>
#define mll map<ll,ll>
#define sii set<ll>
#define sll set<ll>
#define msi map<string,ll>
#define msl map<char,ll>
#define usii unordered_set<ll>
#define usll unordered_set<ll>
#define umii unordered_map<ll,ll>
#define umll unordered_map<ll,ll>
#define umci unordered_map<char,ll>
#define pb push_back
#define pf push_front
#define fi first
#define so second
const ll MOD = 1e9 + 7;
const ll inf = 0x3f3f3f3f;
const ll MAXX = LLONG_MAX;
const ll INF = 0x3f3f3f3f3f3f3f3f;
using namespace std;
const ll MAXN = 362880 + 5; // 876543210的hash值为362880，即最多出现362880种可能
const int dirma[8][2] = { {-2,1},{-2,-1},{-1,2},{-1,-2},{1,2},{1,-2},{2,1},{2,-1} };
const int dir[4][2] = { {-1,0},{1,0},{0,1},{0,-1} };
const int mod = 1e6 + 7;
struct ooo
{

};

void solve()
{
    int n;
    cin >> n;
    vii res(n + 1);
    for (int i = 1; i <= n; i++)
    {
        cin >> res[i];
    }
    int cnt = 0;
    for (int i = 1; i < n; i++)
    {
        for (int j = i + 1; j <= n; j++)
        {
            if (res[i] > res[j])
            {
                cnt++;
            }
            else
            {
                cnt += 2;
            }
        }
    }
    cout << cnt << endl;
    for (int i = 1; i < n; i++)
    {
        for (int j = i + 1; j <= n; j++)
        {
            if (res[i] > res[j])
            {
                cout << res[i] << " " << res[i + 1] << endl;
            }
            else
            {
                cout << res[i + 1] << " " << res[i] << endl;
                cout << res[i] << " " << res[i + 1] << endl;
            }
        }
    }
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll t = 1;
    //cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
Problem: 2050E - Three Strings
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Runtime error on test 13):
#include<bits/stdc++.h>

using namespace std;

void solve(){

	string s,t,j;

	cin>>s>>t>>j;

	int a=s.size(),b=t.size(),c=j.size();

	int dp[300][300]={0};

	for(int i=1;i<=a;i++){

    	dp[i][0]=dp[i-1][0]+(s[i-1]==j[i-1]?1:0);

	}

	for(int i=1;i<=b;i++){

		dp[0][i]=dp[0][i-1]+(t[i-1]==j[i-1]?1:0);

	}

	for(int i=1;i<=a;i++){

		for(int p=1;p<=b;p++){

			dp[i][p]=max(dp[i-1][p]+(s[i-1]==j[i+p-1]?1:0),

						 dp[i][p-1]+(t[p-1]==j[i+p-1]?1:0));	

		}

	}

	int ans=c-dp[a][b];

	cout<<ans<<endl;

} 

int main(){

	int num;

	cin>>num;

	while(num--){

		solve();

	}

	return 0;

} 

Submission (verdict: Runtime error on test 13):
#include<bits/stdc++.h>

using namespace std;

void solve(){

	string s,t,j;

	cin>>s>>t>>j;

	int a=s.size(),b=t.size(),c=j.size();

	int dp[300][300]={0};

	for(int i=1;i<=a;i++){

    	dp[i][0]=dp[i-1][0]+(s[i-1]==j[i-1]?1:0);

	}

	for(int i=1;i<=b;i++){

		dp[0][i]=dp[0][i-1]+(t[i-1]==j[i-1]?1:0);

	}

	if (s[0]==j[0]) dp[1][0] = 1;

    if (t[0]==j[0]) dp[0][1] = 1;

	for(int i=1;i<=a;i++){

		for(int p=1;p<=b;p++){

			dp[i][p]=max(dp[i-1][p]+(s[i-1]==j[i+p-1]?1:0),

						 dp[i][p-1]+(t[p-1]==j[i+p-1]?1:0));	

		}

	}

	int ans=c-dp[a][b];

	cout<<ans<<endl;

} 

int main(){

	int num;

	cin>>num;

	while(num--){

		solve();

	}

	return 0;

}
Problem: 2050E - Three Strings
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Runtime error on test 13):
#include<bits/stdc++.h>

using namespace std;

void solve(){

	string s,t,j;

	cin>>s>>t>>j;

	int a=s.size(),b=t.size(),c=j.size();

	int dp[300][300]={0};

	for(int i=1;i<=a;i++){

    	dp[i][0]=dp[i-1][0]+(s[i-1]==j[i-1]?1:0);

	}

	for(int i=1;i<=b;i++){

		dp[0][i]=dp[0][i-1]+(t[i-1]==j[i-1]?1:0);

	}

	if (s[0]==j[0]) dp[1][0] = 1;

    if (t[0]==j[0]) dp[0][1] = 1;

	for(int i=1;i<=a;i++){

		for(int p=1;p<=b;p++){

			dp[i][p]=max(dp[i-1][p]+(s[i-1]==j[i+p-1]?1:0),

						 dp[i][p-1]+(t[p-1]==j[i+p-1]?1:0));	

		}

	}

	int ans=c-dp[a][b];

	cout<<ans<<endl;

} 

int main(){

	int num;

	cin>>num;

	while(num--){

		solve();

	}

	return 0;

} 

Submission (verdict: Time limit exceeded on test 5):
#include<bits/stdc++.h>

using namespace std;

void solve(){

	string s,t,j;

	cin>>s>>t>>j;

	int a=s.size(),b=t.size(),c=j.size();

	int dp[3000][3000]={0};

	for(int i=1;i<=a;i++){

    	dp[i][0]=dp[i-1][0]+(s[i-1]==j[i-1]?1:0);

	}

	for(int i=1;i<=b;i++){

		dp[0][i]=dp[0][i-1]+(t[i-1]==j[i-1]?1:0);

	}

	if (s[0]==j[0]) dp[1][0] = 1;

    if (t[0]==j[0]) dp[0][1] = 1;

	for(int i=1;i<=a;i++){

		for(int p=1;p<=b;p++){

			dp[i][p]=max(dp[i-1][p]+(s[i-1]==j[i+p-1]?1:0),

						 dp[i][p-1]+(t[p-1]==j[i+p-1]?1:0));	

		}

	}

	int ans=c-dp[a][b];

	cout<<ans<<endl;

} 

int main(){

	int num;

	cin>>num;

	while(num--){

		solve();

	}

	return 0;

}
Problem: 2050E - Three Strings
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Runtime error on test 13):
#include<bits/stdc++.h>

using namespace std;

void solve(){

	string s,t,j;

	cin>>s>>t>>j;

	int a=s.size(),b=t.size(),c=j.size();

	int dp[300][300]={0};

	for(int i=1;i<=a;i++){

    	dp[i][0]=dp[i-1][0]+(s[i-1]==j[i-1]?1:0);

	}

	for(int i=1;i<=b;i++){

		dp[0][i]=dp[0][i-1]+(t[i-1]==j[i-1]?1:0);

	}

	for(int i=1;i<=a;i++){

		for(int p=1;p<=b;p++){

			dp[i][p]=max(dp[i-1][p]+(s[i-1]==j[i+p-1]?1:0),

						 dp[i][p-1]+(t[p-1]==j[i+p-1]?1:0));	

		}

	}

	int ans=c-dp[a][b];

	cout<<ans<<endl;

} 

int main(){

	int num;

	cin>>num;

	while(num--){

		solve();

	}

	return 0;

}
Problem: 2050E - Three Strings
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Time limit exceeded on test 5):
#include<bits/stdc++.h>

using namespace std;

void solve(){

	string s,t,j;

	cin>>s>>t>>j;

	int a=s.size(),b=t.size(),c=j.size();

	int dp[3000][3000]={0};

	for(int i=1;i<=a;i++){

    	dp[i][0]=dp[i-1][0]+(s[i-1]==j[i-1]?1:0);

	}

	for(int i=1;i<=b;i++){

		dp[0][i]=dp[0][i-1]+(t[i-1]==j[i-1]?1:0);

	}

	if (s[0]==j[0]) dp[1][0] = 1;

    if (t[0]==j[0]) dp[0][1] = 1;

	for(int i=1;i<=a;i++){

		for(int p=1;p<=b;p++){

			dp[i][p]=max(dp[i-1][p]+(s[i-1]==j[i+p-1]?1:0),

						 dp[i][p-1]+(t[p-1]==j[i+p-1]?1:0));	

		}

	}

	int ans=c-dp[a][b];

	cout<<ans<<endl;

} 

int main(){

	int num;

	cin>>num;

	while(num--){

		solve();

	}

	return 0;

} 

Submission (verdict: Accepted):
#include<bits/stdc++.h>

using namespace std;

void solve(){

	string s,t,j;

	cin>>s>>t>>j;

	int a=s.size(),b=t.size(),c=j.size();

	int dp[2001][2001]={0};

	for(int i=1;i<=a;i++){

    	dp[i][0]=dp[i-1][0]+(s[i-1]==j[i-1]?1:0);

	}

	for(int i=1;i<=b;i++){

		dp[0][i]=dp[0][i-1]+(t[i-1]==j[i-1]?1:0);

	}

	if (s[0]==j[0]) dp[1][0] = 1;

    if (t[0]==j[0]) dp[0][1] = 1;

	for(int i=1;i<=a;i++){

		for(int p=1;p<=b;p++){

			dp[i][p]=max(dp[i-1][p]+(s[i-1]==j[i+p-1]?1:0),

						 dp[i][p-1]+(t[p-1]==j[i+p-1]?1:0));	

		}

	}

	int ans=c-dp[a][b];

	cout<<ans<<endl;

} 

int main(){

	int num;

	cin>>num;

	while(num--){

		solve();

	}

	return 0;

}
Problem: 2050E - Three Strings
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int t;
    ll dp[1000][1000];
    string a,b,c;
    cin>>t;
    for(int i = 0;i < t ;i++)
    {
        dp[0][0] = 0;
        cin>>a>>b>>c;
        int lena = a.length();
        int lenb = b.length();
        for(int j = 1;j < lena;j++)
            dp[0][j] = dp[0][j - 1] + (a[j] != c[j]);
        for(int j = 1;j < lenb;j++)
            dp[0][j] = dp[0][j - 1] + (b[j] != c[j]);
    }
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf = 1e16;
int main()
{
    int t;
    ll dp[1000][1000];
    string a,b,c;
    cin>>t;
    for(int i = 0;i < t ;i++)
    {
        dp[0][0] = 0;
        cin>>a>>b>>c;
        int lena = a.length();
        int lenb = b.length();
        for(int j = 0;j <= lena;j++)
            for(int k = 0;k <= lenb;k++)
                dp[j][k] = inf;
        for(int j = 1;j <= lena;j++)
            dp[0][j] = dp[0][j - 1] + (a[j - 1] != c[j - 1]);
        for(int j = 1;j <= lenb;j++)
            dp[j][0] = dp[j - 1][0] + (b[j - 1] != c[j - 1]);
        for(int j = 1;j <= lena;j++)
            for(int k = 1;k <= lenb;k++)
                dp[j][k] = min(dp[j - 1][k] + (a[k - 1] != c[j + k - 1]),dp[j][k  - 1] + (b[k - 1] != c[k + j - 1]));
        cout<<dp[lena][lenb]<<endl;
    }
    return 0;
}
Problem: 2050E - Three Strings
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf = 1e16;
int main()
{
    int t;
    ll dp[1000][1000];
    string a,b,c;
    cin>>t;
    for(int i = 0;i < t ;i++)
    {
        dp[0][0] = 0;
        cin>>a>>b>>c;
        int lena = a.length();
        int lenb = b.length();
        for(int j = 0;j <= lena;j++)
            for(int k = 0;k <= lenb;k++)
                dp[j][k] = inf;
        for(int j = 1;j <= lena;j++)
            dp[0][j] = dp[0][j - 1] + (a[j - 1] != c[j - 1]);
        for(int j = 1;j <= lenb;j++)
            dp[j][0] = dp[j - 1][0] + (b[j - 1] != c[j - 1]);
        for(int j = 1;j <= lena;j++)
            for(int k = 1;k <= lenb;k++)
                dp[j][k] = min(dp[j - 1][k] + (a[k - 1] != c[j + k - 1]),dp[j][k  - 1] + (b[k - 1] != c[k + j - 1]));
        cout<<dp[lena][lenb]<<endl;
    }
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf = 1e16;
int main()
{
    int t;
    ll dp[1000][1000];
    string a,b,c;
    cin>>t;
    for(int i = 0;i < t ;i++)
    {
        cin>>a>>b>>c;
        int lena = a.length();
        int lenb = b.length();
        for(int j = 0;j <= lena;j++)
            for(int k = 0;k <= lenb;k++)
                dp[j][k] = inf;
        dp[0][0] = 0;
        for(int j = 1;j <= lena;j++)
            dp[0][j] = dp[0][j - 1] + (a[j - 1] != c[j - 1]);
        for(int j = 1;j <= lenb;j++)
            dp[j][0] = dp[j - 1][0] + (b[j - 1] != c[j - 1]);
        for(int j = 1;j <= lena;j++)
            for(int k = 1;k <= lenb;k++)
                dp[j][k] = min(dp[j - 1][k] + (a[k - 1] != c[j + k - 1]),dp[j][k  - 1] + (b[k - 1] != c[k + j - 1]));
        cout<<dp[lena][lenb]<<endl;
    }
    return 0;
}
Problem: 2050E - Three Strings
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf = 1e16;
int main()
{
    int t;
    ll dp[1000][1000];
    string a,b,c;
    cin>>t;
    for(int i = 0;i < t ;i++)
    {
        cin>>a>>b>>c;
        int lena = a.length();
        int lenb = b.length();
        for(int j = 0;j <= lena;j++)
            for(int k = 0;k <= lenb;k++)
                dp[j][k] = inf;
        dp[0][0] = 0;
        for(int j = 1;j <= lena;j++)
            dp[0][j] = dp[0][j - 1] + (a[j - 1] != c[j - 1]);
        for(int j = 1;j <= lenb;j++)
            dp[j][0] = dp[j - 1][0] + (b[j - 1] != c[j - 1]);
        for(int j = 1;j <= lena;j++)
            for(int k = 1;k <= lenb;k++)
                dp[j][k] = min(dp[j - 1][k] + (a[k - 1] != c[j + k - 1]),dp[j][k  - 1] + (b[k - 1] != c[k + j - 1]));
        cout<<dp[lena][lenb]<<endl;
    }
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf = 1e16;
int main()
{
    int t;
    ll dp[2005][2005];
    string a,b,c;
    cin>>t;
    for(int i = 0;i < t ;i++)
    {
        cin>>a>>b>>c;
        int lena = a.length();
        int lenb = b.length();
        for(int j = 0;j <= lena;j++)
            for(int k = 0;k <= lenb;k++)
                dp[j][k] = inf;
        dp[0][0] = 0;
        for(int j = 1;j <= lena;j++)
            dp[j][0] = dp[j - 1][0] + (a[j - 1] != c[j - 1]);
        for(int j = 1;j <= lenb;j++)
            dp[0][j] = dp[0][j - 1] + (b[j - 1] != c[j - 1]);
        for(int j = 1;j <= lena;j++)
            for(int k = 1;k <= lenb;k++)
                dp[j][k] = min(dp[j - 1][k] + (a[k - 1] != c[j + k - 1]),dp[j][k  - 1] + (b[k - 1] != c[k + j - 1]));
        cout<<dp[lena][lenb]<<endl;
    }
    return 0;
}