ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#define NMAX 55
#define pb push_back

using namespace std;

int v[NMAX];

int main() {
    int tt;
    cin >> tt;
    while (tt--) {
        int n;
        long long maxx = LONG_LONG_MIN;
        cin >> n;
        long long s = 0;
        for (int i = 1; i <= n; i++) {
            cin >> v[i];
            s += v[i];
        }
        maxx = max(maxx, s);
        int p = n;
        while(p > 1) {
            long long s1 = 0, s2 = 0;
            for (int i = 1; i < p; i++) {
                v[i] = v[i + 1] - v[i];
                s1 += v[i];
                s2 += -(v[i]);
            }
            p--;
            maxx = max(maxx, max(s1, s2));
        }
        if (n > 1)
            cout << maxx << '\n';
        else cout << v[1] << '\n';
    }
    return 0;
}


Submission (verdict: Accepted):
#include <bits/stdc++.h>
#define NMAX 55
#define pb push_back

using namespace std;

long long v[NMAX];

int main() {
    int tt;
    cin >> tt;
    while (tt--) {
        int n;
        long long maxx = LONG_LONG_MIN;
        cin >> n;
        long long s = 0;
        for (int i = 1; i <= n; i++) {
            cin >> v[i];
            s += v[i];
        }
        maxx = max(maxx, s);
        int p = n;
        while(p > 1) {
            long long s1 = 0, s2 = 0;
            for (int i = 1; i < p; i++) {
                v[i] = v[i + 1] - v[i];
                s1 += v[i];
                s2 += -(v[i]);
            }
            p--;
            maxx = max(maxx, max(s1, s2));
        }
        if (n > 1)
            cout << maxx << '\n';
        else cout << v[1] << '\n';
    }
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#define NMAX 55
#define pb push_back

using namespace std;

int v[NMAX];

int main() {
    int tt;
    cin >> tt;
    while (tt--) {
        int n, maxx = INT_MIN;
        cin >> n;
        int s = 0;
        for (int i = 1; i <= n; i++) {
            cin >> v[i];
            s += v[i];
        }
        maxx = max(maxx, s);
        int p = n;
        while(p > 1) {
            int s1 = 0, s2 = 0;
            for (int i = 1; i < p; i++) {
                v[i] = v[i + 1] - v[i];
                s1 += v[i];
                s2 += -(v[i]);
            }
            p--;
            maxx = max(maxx, max(s1, s2));
        }
        if (n > 1)
            cout << maxx << '\n';
        else cout << v[1] << '\n';
    }
    return 0;
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 8):
#include <bits/stdc++.h>

using namespace std;

#define MOD 666013
#define ll long long
#define NMAX 100005
#define pb push_back

vector <int> v, aux;

int main()
{
    int tt;
    cin >> tt;
    while (tt--) {
      ///fac un merge 1->r, si unul l->n si aleg cele mai mici (r-l+1)
        int n, l, r, s = 0, ans = INT_MAX;
        cin >> n >> l >> r;
        for (int i = 1; i <= n; i++) {
            int x;
            cin >> x;
            v.pb(x);
        }
        l--, r--;
        for (int i = 0; i <= r; i++) aux.pb(v[i]);
        sort(aux.begin(), aux.end());
        if (!aux.empty())
            for (int i = 0; i <= r - l; i++)
                s += aux[i];
        ans = min(ans, s);

        aux.clear(), s = 0;

        for (int i = l; i < v.size(); i++)
            aux.pb(v[i]);
        sort(aux.begin(), aux.end());
        if (!aux.empty())
            for (int i = 0; i <= r - l; i++)
             s += aux[i];
        ans = min(ans, s);
        cout << ans << '\n';
        v.clear();
        aux.clear();
    }
    return 0;
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 8):
#include <bits/stdc++.h>

using namespace std;

#define MOD 666013
#define ll long long
#define NMAX 100005
#define pb push_back

vector <int> v, aux;

int main()
{
    int tt;
    cin >> tt;
    while (tt--) {
      ///fac un merge 1->r, si unul l->n si aleg cele mai mici (r-l+1)
        int n, l, r, s = 0, ans = INT_MAX;
        cin >> n >> l >> r;
        for (int i = 1; i <= n; i++) {
            int x;
            cin >> x;
            v.pb(x);
        }
        l--, r--;
        for (int i = 0; i <= r; i++) aux.pb(v[i]);
        sort(aux.begin(), aux.end());
        if (!aux.empty())
            for (int i = 0; i <= r - l; i++)
                s += aux[i];
        ans = min(ans, s);

        aux.clear(), s = 0;

        for (int i = l; i < v.size(); i++)
            aux.pb(v[i]);
        sort(aux.begin(), aux.end());
        if (!aux.empty())
            for (int i = 0; i <= r - l; i++)
             s += aux[i];
        ans = min(ans, s);
        cout << ans << '\n';
        v.clear();
        aux.clear();
    }
    return 0;
}


Submission (verdict: Wrong answer on test 8):
#include <bits/stdc++.h>



using namespace std;



#define MOD 666013

#define long long int

#define NMAX 100005

#define pb push_back



vector <int> v, aux;



signed main()

{

    int tt;

    cin >> tt;

    while (tt--) {

      ///fac un merge 1->r, si unul l->n si aleg cele mai mici (r-l+1)

        int n, l, r, s = 0, ans = INT_MAX;

        cin >> n >> l >> r;

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

            int x;

            cin >> x;

            v.pb(x);

        }

        l--, r--;

        for (int i = 0; i <= r; i++) aux.pb(v[i]);

        sort(aux.begin(), aux.end());

        if (!aux.empty())

            for (int i = 0; i <= r - l; i++)

                s += aux[i];

        ans = min(ans, s);



        aux.clear(), s = 0;



        for (int i = l; i < v.size(); i++)

            aux.pb(v[i]);

        sort(aux.begin(), aux.end());

        if (!aux.empty())

            for (int i = 0; i <= r - l; i++)

             s += aux[i];

        ans = min(ans, s);

        cout << ans << '\n';

        v.clear();

        aux.clear();

    }

    return 0;

}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 8):
#include <bits/stdc++.h>

using namespace std;

#define MOD 666013
#define int long long
#define NMAX 100005
#define pb push_back

vector <int> v, aux;

signed main()
{
    int tt;
    cin >> tt;
    while (tt--) {
      ///fac un merge 1->r, si unul l->n si aleg cele mai mici (r-l+1)
        int n, l, r, s = 0, ans = INT_MAX;
        cin >> n >> l >> r;
        for (int i = 1; i <= n; i++) {
            int x;
            cin >> x;
            v.pb(x);
        }
        l--, r--;
        for (int i = 0; i <= r; i++) aux.pb(v[i]);
        sort(aux.begin(), aux.end());
        if (!aux.empty())
            for (int i = 0; i <= r - l; i++)
                s += aux[i];
        ans = min(ans, s);

        aux.clear(), s = 0;

        for (int i = l; i < v.size(); i++)
            aux.pb(v[i]);
        sort(aux.begin(), aux.end());
        if (!aux.empty())
            for (int i = 0; i <= r - l; i++)
             s += aux[i];
        ans = min(ans, s);
        cout << ans << '\n';
        v.clear();
        aux.clear();
    }
    return 0;
}


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



using namespace std;



#define MOD 666013

#define int long long

#define NMAX 100005

#define pb push_back



vector <int> v, aux;



signed main()

{

    int tt;

    cin >> tt;

    while (tt--) {

      ///fac un merge 1->r, si unul l->n si aleg cele mai mici (r-l+1)

        int n, l, r, s = 0, ans = LONG_LONG_MAX;

        cin >> n >> l >> r;

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

            int x;

            cin >> x;

            v.pb(x);

        }

        l--, r--;

        for (int i = 0; i <= r; i++) aux.pb(v[i]);

        sort(aux.begin(), aux.end());

        if (!aux.empty())

            for (int i = 0; i <= r - l; i++)

                s += aux[i];

        ans = min(ans, s);



        aux.clear(), s = 0;



        for (int i = l; i < v.size(); i++)

            aux.pb(v[i]);

        sort(aux.begin(), aux.end());

        if (!aux.empty())

            for (int i = 0; i <= r - l; i++)

             s += aux[i];

        ans = min(ans, s);

        cout << ans << '\n';

        v.clear();

        aux.clear();

    }

    return 0;

}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 8):
#include <bits/stdc++.h>



using namespace std;



#define MOD 666013

#define long long int

#define NMAX 100005

#define pb push_back



vector <int> v, aux;



signed main()

{

    int tt;

    cin >> tt;

    while (tt--) {

      ///fac un merge 1->r, si unul l->n si aleg cele mai mici (r-l+1)

        int n, l, r, s = 0, ans = INT_MAX;

        cin >> n >> l >> r;

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

            int x;

            cin >> x;

            v.pb(x);

        }

        l--, r--;

        for (int i = 0; i <= r; i++) aux.pb(v[i]);

        sort(aux.begin(), aux.end());

        if (!aux.empty())

            for (int i = 0; i <= r - l; i++)

                s += aux[i];

        ans = min(ans, s);



        aux.clear(), s = 0;



        for (int i = l; i < v.size(); i++)

            aux.pb(v[i]);

        sort(aux.begin(), aux.end());

        if (!aux.empty())

            for (int i = 0; i <= r - l; i++)

             s += aux[i];

        ans = min(ans, s);

        cout << ans << '\n';

        v.clear();

        aux.clear();

    }

    return 0;

}



Submission (verdict: Wrong answer on test 8):
#include <bits/stdc++.h>

using namespace std;

#define MOD 666013
#define int long long
#define NMAX 100005
#define pb push_back

vector <int> v, aux;

signed main()
{
    int tt;
    cin >> tt;
    while (tt--) {
      ///fac un merge 1->r, si unul l->n si aleg cele mai mici (r-l+1)
        int n, l, r, s = 0, ans = INT_MAX;
        cin >> n >> l >> r;
        for (int i = 1; i <= n; i++) {
            int x;
            cin >> x;
            v.pb(x);
        }
        l--, r--;
        for (int i = 0; i <= r; i++) aux.pb(v[i]);
        sort(aux.begin(), aux.end());
        if (!aux.empty())
            for (int i = 0; i <= r - l; i++)
                s += aux[i];
        ans = min(ans, s);

        aux.clear(), s = 0;

        for (int i = l; i < v.size(); i++)
            aux.pb(v[i]);
        sort(aux.begin(), aux.end());
        if (!aux.empty())
            for (int i = 0; i <= r - l; i++)
             s += aux[i];
        ans = min(ans, s);
        cout << ans << '\n';
        v.clear();
        aux.clear();
    }
    return 0;
}
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double lld;
#define PI 3.14159265358979323846
#define MOD 1000000007
#define INF 1e18
#define endl "\n"

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; // *find_by_order(index), order_of_key(val)

#ifndef ONLINE_JUDGE
    #include <E:\CP\debug.h>
#else
#define debug(x)
#endif

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    // freopen("inputFileName.txt", "r", stdin);
    // freopen("outputFileName.txt", "w", stdout);

    ll t; cin >> t;
    while(t--) {
        string s;
        cin >> s;
        ll n = s.length();
        for(ll i = 0; i < min(n, (ll)10); i++) {
            for(ll j = i+1; j >= 1; j--) {
                if(s[j-1] < s[j] - 1) {
                    s[j] = s[j] - 1;
                    swap(s[j], s[j-1]);
                }
            }
        }
        if(n > 10) {
            for(ll i = 1, j = i+10; j < n; j++, i++) {
                for(ll k = j; k >= i+1; k--) {
                    if(s[j-1] < s[j] - 1) {
                        s[j] = s[j] - 1;
                        swap(s[j], s[j-1]);
                    }
                }
            }
        }
        cout << s << endl;
    }

    return 0;
}

Submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double lld;
#define PI 3.14159265358979323846
#define MOD 1000000007
#define INF 1e18
#define endl "\n"

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; // *find_by_order(index), order_of_key(val)

#ifndef ONLINE_JUDGE
    #include <E:\CP\debug.h>
#else
#define debug(x)
#endif

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    // freopen("inputFileName.txt", "r", stdin);
    // freopen("outputFileName.txt", "w", stdout);

    ll t; cin >> t;
    while(t--) {
        string s;
        cin >> s;
        ll n = s.length();
        for(ll i = 0; i < min(n, (ll)10); i++) {
            for(ll j = i+1; j >= 1; j--) {
                if(s[j-1] < s[j] - 1) {
                    s[j] = s[j] - 1;
                    swap(s[j], s[j-1]);
                }
            }
        }
        for(ll i = 0, j = i+10; j < n; j++, i++) {
            for(ll k = j; k >= i+1; k--) {
                if(s[j-1] < s[j] - 1) {
                    s[j] = s[j] - 1;
                    swap(s[j], s[j-1]);
                }
            }
        }
        cout << s << endl;
    }

    return 0;
}
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double lld;
#define PI 3.14159265358979323846
#define MOD 1000000007
#define INF 1e18
#define endl "\n"

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; // *find_by_order(index), order_of_key(val)

#ifndef ONLINE_JUDGE
    #include <E:\CP\debug.h>
#else
#define debug(x)
#endif

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    // freopen("inputFileName.txt", "r", stdin);
    // freopen("outputFileName.txt", "w", stdout);

    ll t; cin >> t;
    while(t--) {
        string s;
        cin >> s;
        ll n = s.length();
        for(ll i = 0; i < min(n, (ll)10); i++) {
            for(ll j = i+1; j >= 1; j--) {
                if(s[j-1] < s[j] - 1) {
                    s[j] = s[j] - 1;
                    swap(s[j], s[j-1]);
                }
            }
        }
        for(ll i = 0, j = i+10; j < n; j++, i++) {
            for(ll k = j; k >= i+1; k--) {
                if(s[j-1] < s[j] - 1) {
                    s[j] = s[j] - 1;
                    swap(s[j], s[j-1]);
                }
            }
        }
        cout << s << endl;
    }

    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double lld;
#define PI 3.14159265358979323846
#define MOD 1000000007
#define INF 1e18
#define endl "\n"

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; // *find_by_order(index), order_of_key(val)

#ifndef ONLINE_JUDGE
    #include <E:\CP\debug.h>
#else
#define debug(x)
#endif

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    // freopen("inputFileName.txt", "r", stdin);
    // freopen("outputFileName.txt", "w", stdout);

    ll t; cin >> t;
    while(t--) {
        string s;
        cin >> s;
        ll n = s.length();
        for(ll i = 0; i < min(n, (ll)10); i++) {
            for(ll j = i+1; j >= 1; j--) {
                if(s[j-1] < s[j] - 1) {
                    s[j] = s[j] - 1;
                    swap(s[j], s[j-1]);
                }
            }
        }
        for(ll i = 0, j = i+10; j < n; j++, i++) {
            for(ll k = j; k >= i+1; k--) {
                if(s[k-1] < s[k] - 1) {
                    s[k] = s[k] - 1;
                    swap(s[k], s[k-1]);
                }
            }
        }
        cout << s << endl;
    }

    return 0;
}
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double lld;
#define PI 3.14159265358979323846
#define MOD 1000000007
#define INF 1e18
#define endl "\n"

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; // *find_by_order(index), order_of_key(val)

#ifndef ONLINE_JUDGE
    #include <E:\CP\debug.h>
#else
#define debug(x)
#endif

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    // freopen("inputFileName.txt", "r", stdin);
    // freopen("outputFileName.txt", "w", stdout);

    ll t; cin >> t;
    while(t--) {
        string s;
        cin >> s;
        ll n = s.length();
        for(ll i = 0; i < min(n, (ll)10); i++) {
            for(ll j = i+1; j >= 1; j--) {
                if(s[j-1] < s[j] - 1) {
                    s[j] = s[j] - 1;
                    swap(s[j], s[j-1]);
                }
            }
        }
        if(n > 10) {
            for(ll i = 1, j = i+10; j < n; j++, i++) {
                for(ll k = j; k >= i+1; k--) {
                    if(s[j-1] < s[j] - 1) {
                        s[j] = s[j] - 1;
                        swap(s[j], s[j-1]);
                    }
                }
            }
        }
        cout << s << endl;
    }

    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;


void solve() {
	int N;
	cin >> N;

	vector<int>final_order_of_race(N + 1);
	vector<int>rank_of_which_car(N + 1);
	for (int rank = 1; rank <= N; rank++) {
		int car;
		cin >> car;
		final_order_of_race[car] = rank;
		rank_of_which_car[rank] = car;
	}
	vector<pair<int, int>>maximum_long_over_seq;
	set<int>order;
	for (int car = N; car >= 1; car--) {
		for (int front_car = 1; front_car < car; front_car++) {
			maximum_long_over_seq.push_back({car, front_car});
		}
		if (order.empty()) {
			order.insert(final_order_of_race[car]);
		}
		else {
			for (auto rank : order) {
				if (final_order_of_race[car] < rank) {
					maximum_long_over_seq.push_back({car, rank_of_which_car[rank]});
				}
				else {
					break;
				}
			}
			order.insert(final_order_of_race[car]);
		}
	}

	int M = maximum_long_over_seq.size();
	cout << M << "\n";
	for (int i = 0; i < M; i++ ) {
		cout << maximum_long_over_seq[i].first << " " << maximum_long_over_seq[i].second << "\n";
	}
}



int main()
{
#ifndef ONLINE_JUDGE
	freopen("input1.txt", "r", stdin);
	freopen("output1.txt", "w", stdout);
#endif


	ios_base::sync_with_stdio(0);
	cin.tie(0);

	solve();

	return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;


void solve() {
	int N;
	cin >> N;

	vector<int>final_order_of_race(N + 1);
	vector<int>rank_of_which_car(N + 1);
	for (int rank = 1; rank <= N; rank++) {
		int car;
		cin >> car;
		final_order_of_race[car] = rank;
		rank_of_which_car[rank] = car;
	}
	vector<pair<int, int>>maximum_long_over_seq;
	set<int>order;
	for (int car = N; car >= 1; car--) {
		for (int front_car = 1; front_car < car; front_car++) {
			maximum_long_over_seq.push_back({car, front_car});
		}
		if (order.empty()) {
			order.insert(final_order_of_race[car]);
		}
		else {
			for (auto rank : order) {
				if (final_order_of_race[car] < rank) {
					maximum_long_over_seq.push_back({car, rank_of_which_car[rank]});
				}
				else {
					break;
				}
			}
			order.insert(final_order_of_race[car]);
		}
	}

	int M = maximum_long_over_seq.size();
	cout << M << "\n";
	for (int i = 0; i < M; i++ ) {
		cout << maximum_long_over_seq[i].first << " " << maximum_long_over_seq[i].second << "\n";
	}
}



int main()
{
#ifndef ONLINE_JUDGE
	freopen("input1.txt", "r", stdin);
	freopen("output1.txt", "w", stdout);
#endif


	ios_base::sync_with_stdio(0);
	cin.tie(0);

	solve();

	return 0;
}

Submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
using namespace std;


void solve() {
	int N;
	cin >> N;

	vector<int>final_order_of_race(N + 1);
	vector<int>rank_of_which_car(N + 1);
	for (int rank = 1; rank <= N; rank++) {
		int car;
		cin >> car;
		final_order_of_race[car] = rank;
		rank_of_which_car[rank] = car;
	}
	vector<pair<int, int>>maximum_long_over_seq;
	set<int>order;
	for (int car = N; car >= 1; car--) {
		for (int front_car = car - 1; front_car >= 1; front_car--) {
			maximum_long_over_seq.push_back({car, front_car});
		}
		if (order.empty()) {
			order.insert(final_order_of_race[car]);
		}
		else {
			for (auto rank : order) {
				if (final_order_of_race[car] < rank) {
					maximum_long_over_seq.push_back({car, rank_of_which_car[rank]});
				}
				else {
					break;
				}
			}
			order.insert(final_order_of_race[car]);
		}
	}

	int M = maximum_long_over_seq.size();
	cout << M << "\n";
	for (int i = 0; i < M; i++ ) {
		cout << maximum_long_over_seq[i].first << " " << maximum_long_over_seq[i].second << "\n";
	}
}



int main()
{
#ifndef ONLINE_JUDGE
	freopen("input1.txt", "r", stdin);
	freopen("output1.txt", "w", stdout);
#endif


	ios_base::sync_with_stdio(0);
	cin.tie(0);

	solve();

	return 0;
}