ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2049C - MEX Cycle
Language: C++23 (GCC 14-64, msys2)


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



using namespace std;



template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }

template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ", "; return os << '}'; }

void dbg_out() { cerr << endl; }

template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }

#ifdef LOCAL

#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)

#else

#define dbg(...)

#endif



#define ar array

#define ll long long

#define ld long double

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

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



const int MAX_N = 1e5 + 5;

const ll MOD = 1e9 + 7;

const ll INF = 1e9;

const ld EPS = 1e-9;







void solve() {

    ll n,x,y;

    cin>>n>>x>>y;

    if(x==1 && y==n || y-x==1 || (y-x)%2!=0){

    	if(n%2==0){

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

    			if(i%2==0)cout<<1<<" ";

    			else cout<<0<<" ";





    		}

    		cout<<'\n';

    	}

    	else{

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

    			if(i%2==0)cout<<1<<" ";

    			else cout<<0<<" ";





    		}

    		cout<<2<<'\n';

    	}

    }

    else{

    	if(n%2==0){

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

    			if(i+1==x)cout<<2<<" ";

    			else if(i%2==0)cout<<1<<" ";

    			else cout<<0<<" ";

    		}

    		cout<<'\n';

    	}

    	else{

    		for(int i=1;i<=x-1;i++){

    			if(i%2==0)cout<<0<<" ";

    			else cout<<1<<" ";

    		}

    		cout<<2<<" ";

    		if(x%2==0){

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

    				if(i%2!=0)cout<<0<<" ";

    				else cout<<1<<" ";

    			}

    		}

    		else{

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

    				if(i%2!=0)cout<<1<<" ";

    				else cout<<0<<" ";

    			}



    		}

    		cout<<'\n';

    	}





    }

    

}



int main() {

    ios_base::sync_with_stdio(0);

    cin.tie(0); cout.tie(0);

    int tc = 1;

     cin >> tc;

    for (int t = 1; t <= tc; t++) {

        // cout << "Case #" << t << ": ";

        solve();

    }

    

}
Problem: 2061D - Kevin and Numbers
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 9):
#include<bits/stdc++.h>
using namespace std;
bool isequal(multiset<long long>&a, multiset<long long>&b)
{
    int n=a.size();
    int m=b.size();
    if(n!=m) return false;
    auto it_a=a.begin(),it_b=b.begin();
    for(int i=0;i<n;i++)
    if((*it_a++)!=(*it_b++)) return false;
    return true;
}
void removecommon(multiset<long long> &a, multiset<long long>&b)
{
    auto it_a=a.begin();
    while(it_a!=a.end())
    {
        auto it_b=b.find(*it_a);
        if(it_b!=b.end())
        {
            it_a=a.erase(it_a);
            b.erase(it_b);
        }
        else
        it_a++;
    }
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,m,x;
        cin>>n>>m;
        multiset<long long> a,b;
        for(int i=0;i<n;i++)
        cin>>x,a.insert(x);
        for(int i=0;i<m;i++)
        cin>>x,b.insert(x);
        removecommon(a,b);
        int diff=a.size()-b.size();
        auto ita=a.begin();
        auto itb=b.begin();
        if(a.empty() and b.empty())
        {
            cout<<"YES\n";
            continue;
        }
        if(diff<0 or *ita>*itb or b.empty()) 
        {
            cout<<"NO\n";
            continue;
        }
        bool flag=false;
        while(diff--)
        {
            auto it_b=b.begin();
            auto it1=a.begin();
            if(*it_b==*it1) it_b++,it1++;
            auto it2=next(it1,1);
            if(abs(*it2-*it1)>1 and *it1!=*it_b)
            {
                flag=true;
                break;
            }
            it2=next(it1,1);
            long long nxt=*it1+*it2;
            a.erase(it1);
            a.erase(it2);
            a.insert(nxt);
        }
        if(isequal(a,b) and !flag) cout<<"YES\n";
        else cout<<"NO\n";
    }
}
Problem: 2063C - Remove Exactly Two
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> du(n + 1, 0);
    vector<vector<int>> node(n + 1);
    for (int i = 1; i < n; ++i) {
        int u, v;
        cin >> u >> v;
        ++du[u];
        ++du[v];
        node[u].push_back(v);
        node[v].push_back(u);
    }
    vector<int> p(n + 1);
    iota(p.begin(), p.end(), 0);
    int ans = 0;
    sort(p.begin() + 1, p.begin() + 1 + n, [&] (int fr, int be) {
        return du[fr] > du[be];
    });
    ans += max(du[p[1]] - 1, 0);
    for (auto& v : node[p[1]]) {
        --du[v];
    }
    int tmp = p[1];
    sort(p.begin() + 1, p.begin() + 1 + n, [&] (int fr, int be) {
        return du[fr] > du[be];
    });
    if (p[1] != tmp) {
        ans += max(du[p[1]] - 1, 0);
    }else if(p[2] != tmp) {
        ans += max(du[p[2]] - 1, 0);
    }
    cout << ans << "\n";
    return;
}
int main() {
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
void solve() {
    int n;
    cin >> n;
    vector<int> du(n + 1, 0);
    vector<vector<int>> node(n + 1);
    for (int i = 1; i < n; ++i) {
        int u, v;
        cin >> u >> v;
        ++du[u];
        ++du[v];
        node[u].push_back(v);
        node[v].push_back(u);
    }
    vector<int> p(n + 1);
    iota(p.begin(), p.end(), 0);
    int ans = 1;
    sort(p.begin() + 1, p.begin() + 1 + n, [&] (int fr, int be) {
        return du[fr] > du[be];
    });
    ans += du[p[1]] - 1;
    // cout << ans << "\n";
    for (auto& v : node[p[1]]) {
        --du[v];
    }
    int tmp = p[1];
    sort(p.begin() + 1, p.begin() + 1 + n, [&] (int fr, int be) {
        return du[fr] > du[be];
    });
    if (p[1] != tmp) {
        ans += du[p[1]] - 1;
    }else if(p[2] != tmp) {
        ans += du[p[2]] - 1;
    }
    // cout << p[1] << " " << p[2] << "\n";
    cout << ans << "\n";
    return;
}
int main() {
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}
Problem: 2063C - Remove Exactly Two
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
void solve() {
    int n;
    cin >> n;
    vector<int> du(n + 1, 0);
    vector<vector<int>> node(n + 1);
    for (int i = 1; i < n; ++i) {
        int u, v;
        cin >> u >> v;
        ++du[u];
        ++du[v];
        node[u].push_back(v);
        node[v].push_back(u);
    }
    vector<int> p(n + 1);
    iota(p.begin(), p.end(), 0);
    int ans = 1;
    sort(p.begin() + 1, p.begin() + 1 + n, [&] (int fr, int be) {
        return du[fr] > du[be];
    });
    ans += du[p[1]] - 1;
    // cout << ans << "\n";
    for (auto& v : node[p[1]]) {
        --du[v];
    }
    int tmp = p[1];
    sort(p.begin() + 1, p.begin() + 1 + n, [&] (int fr, int be) {
        return du[fr] > du[be];
    });
    if (p[1] != tmp) {
        ans += du[p[1]] - 1;
    }else if(p[2] != tmp) {
        ans += du[p[2]] - 1;
    }
    // cout << p[1] << " " << p[2] << "\n";
    cout << ans << "\n";
    return;
}
int main() {
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
void solve() {
    int n;
    cin >> n;
    vector<int> du(n + 1, 0);
    vector<vector<int>> node(n + 1);
    for (int i = 1; i < n; ++i) {
        int u, v;
        cin >> u >> v;
        ++du[u];
        ++du[v];
        node[u].push_back(v);
        node[v].push_back(u);
    }
    int ans = 0;
    multiset<int> sdu;
    for (int i = 1; i <= n; ++i) {
        sdu.insert(du[i]);
    }
    for (int i = 1; i <= n; ++i) {
        int sum = 1;
        sdu.erase(sdu.find(du[i]));
        sum += du[i] - 1;
        for (auto& v : node[i]) {
            sdu.erase(sdu.find(du[v]));
            sdu.insert(du[v] - 1);
        }
        sum += *sdu.rbegin() - 1;
        for (auto& v : node[i]) {
            sdu.erase(sdu.find(du[v] - 1));
            sdu.insert(du[v]);
        }
        sdu.insert(du[i]);
        ans = max(ans, sum);
    }
    cout << ans << "\n";
    return;
}
int main() {
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}
Problem: 2063C - Remove Exactly Two
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> du(n + 1, 0);
    vector<vector<int>> node(n + 1);
    for (int i = 1; i < n; ++i) {
        int u, v;
        cin >> u >> v;
        ++du[u];
        ++du[v];
        node[u].push_back(v);
        node[v].push_back(u);
    }
    vector<int> p(n + 1);
    iota(p.begin(), p.end(), 0);
    int ans = 0;
    sort(p.begin() + 1, p.begin() + 1 + n, [&] (int fr, int be) {
        return du[fr] > du[be];
    });
    ans += du[p[1]] - 1;
    for (auto& v : node[p[1]]) {
        --du[v];
    }
    int tmp = p[1];
    sort(p.begin() + 1, p.begin() + 1 + n, [&] (int fr, int be) {
        return du[fr] > du[be];
    });
    if (p[1] != tmp) {
        ans += du[p[1]] - 1;
    }else if(p[2] != tmp) {
        ans += du[p[2]] - 1;
    }
    cout << ans << "\n";
    return;
}
int main() {
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}
Problem: 2063C - Remove Exactly Two
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> du(n + 1, 0);
    vector<vector<int>> node(n + 1);
    for (int i = 1; i < n; ++i) {
        int u, v;
        cin >> u >> v;
        ++du[u];
        ++du[v];
        node[u].push_back(v);
        node[v].push_back(u);
    }
    vector<int> p(n + 1);
    iota(p.begin(), p.end(), 0);
    int ans = 0;
    sort(p.begin() + 1, p.begin() + 1 + n, [&] (int fr, int be) {
        return du[fr] > du[be];
    });
    ans += du[p[1]] - 1;
    for (auto& v : node[p[1]]) {
        --du[v];
    }
    int tmp = p[1];
    sort(p.begin() + 1, p.begin() + 1 + n, [&] (int fr, int be) {
        return du[fr] > du[be];
    });
    if (p[1] != tmp) {
        ans += du[p[1]] - 1;
    }else if(p[2] != tmp) {
        ans += du[p[2]] - 1;
    }
    cout << ans << "\n";
    return;
}
int main() {
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
void solve() {
    int n;
    cin >> n;
    vector<int> du(n + 1, 0);
    vector<vector<int>> node(n + 1);
    for (int i = 1; i < n; ++i) {
        int u, v;
        cin >> u >> v;
        ++du[u];
        ++du[v];
        node[u].push_back(v);
        node[v].push_back(u);
    }
    vector<int> p(n + 1);
    iota(p.begin(), p.end(), 0);
    int ans = 0;
    sort(p.begin() + 1, p.begin() + 1 + n, [&] (int fr, int be) {
        return du[fr] > du[be];
    });
    ans += max(du[p[1]] - 1, 0);
    for (auto& v : node[p[1]]) {
        --du[v];
    }
    int tmp = p[1];
    sort(p.begin() + 1, p.begin() + 1 + n, [&] (int fr, int be) {
        return du[fr] > du[be];
    });
    if (p[1] != tmp) {
        ans += max(du[p[1]] - 1, 0);
    }else if(p[2] != tmp) {
        ans += max(du[p[2]] - 1, 0);
    }
    cout << ans << "\n";
    return;
}
int main() {
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)


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

#define ll long long
#define fi first
#define se second

void Freopen () {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

const ll N = 1e5 + 5;
const ll INF = 1e18 + 5;
const ll mod = 1e9 + 7;

using namespace std;

ll l, r;

void ma1n () {
    cin >> l >> r;
    for (int bit = 29; bit >= 0; bit--) {
        if ((l & (1ll << bit)) != (r & (1ll << bit))) {
            ll a = (1ll << bit), b = (1ll << bit) - 1, c = r;
            if (c == a) c -= 2;
            else if (c == b) c--;
            cout << a << " " << b << " " << c << "\n";
        }
    }
}

int main() {
    Freopen ();
    int t = 1;
    cin >> t;
    for (int i = 1; i <= t; i++) {
        ma1n ();
    }
    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>

#define ll long long
#define fi first
#define se second

void Freopen () {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

const ll N = 1e5 + 5;
const ll INF = 1e18 + 5;
const ll mod = 1e9 + 7;

using namespace std;

ll l, r;

void ma1n () {
    cin >> l >> r;
    for (int bit = 29; bit >= 0; bit--) {
        if ((l & (1ll << bit)) != (r & (1ll << bit))) {
            ll a = (1ll << bit), b = (1ll << bit) - 1, c = r;
            if (c == a) c -= 2;
            else if (c == b) c--;
            cout << a << " " << b << " " << c << "\n";
        }
    }
}

int main() {
    Freopen ();
    int t = 1;
    cin >> t;
    for (int i = 1; i <= t; i++) {
        ma1n ();
    }
    return 0;
}


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

#define ll long long
#define fi first
#define se second

void Freopen () {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

const ll N = 1e5 + 5;
const ll INF = 1e18 + 5;
const ll mod = 1e9 + 7;

using namespace std;

ll l, r;

void ma1n () {
    cin >> l >> r;
    for (int bit = 29; bit >= 0; bit--) {
        if ((l & (1ll << bit)) != (r & (1ll << bit))) {
            ll a = (1ll << bit), b = (1ll << bit) - 1, c = r;
            if (c == a) c -= 2;
            else if (c == b) c--;
            cout << a << " " << b << " " << c << "\n";
            return;
        }
    }
}

int main() {
    Freopen ();
    int t = 1;
    cin >> t;
    for (int i = 1; i <= t; i++) {
        ma1n ();
    }
    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>

#define ll long long
#define fi first
#define se second

void Freopen () {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

const ll N = 1e5 + 5;
const ll INF = 1e18 + 5;
const ll mod = 1e9 + 7;

using namespace std;

ll l, r;

void ma1n () {
    cin >> l >> r;
    for (int bit = 29; bit >= 0; bit--) {
        if ((l & (1ll << bit)) != (r & (1ll << bit))) {
            ll a = (1ll << bit), b = (1ll << bit) - 1, c = r;
            if (c == a) c -= 2;
            else if (c == b) c--;
            cout << a << " " << b << " " << c << "\n";
            return;
        }
    }
}

int main() {
    Freopen ();
    int t = 1;
    cin >> t;
    for (int i = 1; i <= t; i++) {
        ma1n ();
    }
    return 0;
}


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

#define ll long long
#define fi first
#define se second

void Freopen () {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

const ll N = 1e5 + 5;
const ll INF = 1e18 + 5;
const ll mod = 1e9 + 7;

using namespace std;

ll l, r;

void ma1n () {
    cin >> l >> r;
    ll a = 0, b, c;
    for (int bit = 29; bit >= 0; bit--) {
        if ((l & (1ll << bit)) != (r & (1ll << bit))) {
            a += (1ll << bit);
            b = a - 1, c = r;
            if (c == a) c -= 2;
            else if (c == b) c--;
            cout << a << " " << b << " " << c << "\n";
            return;
        }
        if ((l & (1ll << bit))) {
            a += (1ll << bit);
        }
    }
}

int main() {
    Freopen ();
    int t = 1;
    cin >> t;
    for (int i = 1; i <= t; i++) {
        ma1n ();
    }
    return 0;
}
Problem: 2050E - Three Strings
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Compilation error):
#include<bits/stdc++.h.
using namespace std;

#define int long long
#define inf 1e9

signed main(){
    int t; cin >> t;
    while(t--){
        string a, b, c; cin >> a >> b >> c;
        int lenA = a.size(), lenB = b.size();
        vector<int> dp(1 + lenA, vector<int>(1 + lenB, inf));
        dp[0][0] = 0;
        for(int i = 0; i < lenA; ++i){
            for(int j = 0; j < lenB; ++j){
                if(i <= lenA) dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + (a[i] != c[i + j]));
                if(j <= lenB) dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + (b[j] != c[i + j]));
            }
        }
        cout << dp[lenA][lenB] << endl;
    }
    return 0;
}

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

#define int long long
#define inf 1e9

signed main() {
    int t;
    cin >> t;
    while(t--) {
        string a, b, c;
        cin >> a >> b >> c;
        int lenA = a.size(), lenB = b.size();
        vector<vector<int>> dp(lenA + 1, vector<int>(lenB + 1, inf));
        dp[0][0] = 0;
        for (int i = 0; i <= lenA; ++i) {
            for (int j = 0; j <= lenB; ++j) {
                if (i < lenA) dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + (a[i] != c[i + j]));
                if (j < lenB) dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + (b[j] != c[i + j]));
            }
        }
        cout << dp[lenA][lenB] << endl;
    }
    return 0;
}
Problem: 2050E - Three Strings
Language: C++23 (GCC 14-64, msys2)

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

#define int long long

signed main(){
    int t;
    cin >> t;
    while(t--) {
        vector<int> fq(26, 0);
        string a, b, c;
        cin >> a >> b >> c;
        for(const auto& it : a) fq[it - 'a']++;
        for(const auto& it : b) fq[it - 'a']++;
        for(const auto& it : c) fq[it - 'a']--;
        int sum = 0;
        for(const auto& it : fq) sum += max(it, 0LL);
        cout << sum << endl;
    }
    return 0;
}

Submission (verdict: Compilation error):
#include<bits/stdc++.h.
using namespace std;

#define int long long
#define inf 1e9

signed main(){
    int t; cin >> t;
    while(t--){
        string a, b, c; cin >> a >> b >> c;
        int lenA = a.size(), lenB = b.size();
        vector<int> dp(1 + lenA, vector<int>(1 + lenB, inf));
        dp[0][0] = 0;
        for(int i = 0; i < lenA; ++i){
            for(int j = 0; j < lenB; ++j){
                if(i <= lenA) dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + (a[i] != c[i + j]));
                if(j <= lenB) dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + (b[j] != c[i + j]));
            }
        }
        cout << dp[lenA][lenB] << endl;
    }
    return 0;
}
Problem: 2050E - Three Strings
Language: C++23 (GCC 14-64, msys2)


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

#define int long long

signed main(){
    int t;
    cin >> t;
    while(t--) {
        vector<int> fq(26, 0);
        string a, b, c;
        cin >> a >> b >> c;
        for(const auto& it : a) fq[it - 'a']++;
        for(const auto& it : b) fq[it - 'a']++;
        for(const auto& it : c) fq[it - 'a']--;
        int sum = 0;
        for(const auto& it : fq) sum += max(it, 0LL);
        cout << sum << endl;
    }
    return 0;
}
Problem: 2063B - Subsequence Update
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include<iostream>

#include<bitset>

#include<utility>

#include<cmath>

#include<iterator>

#include<vector>

#include<algorithm>

#include<string>

#include<numeric>

using namespace std;





int main(){

int c;

cin>>c;

long long int arr[c];

for(int k=0;k<c;k++){

    long long int x,y,z,p,m=0;

    cin>>x>>y>>z;

    vector<long long int>vec;

    for(long long j=0;j<x;j++){

        cin>>p;

        vec.push_back(p);

    }

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

    z=z-y+1;

    z=min(z,x);

     for(long long int j=0;j<z;j++){

        m+=vec[j];

    }

    arr[k]=m;

}

for(int k=0;k<c;k++){

    cout<<arr[k]<<endl;

}

}

Submission (verdict: Accepted):
#include<iostream>
#include<bitset>
#include<utility>
#include<cmath>
#include<iterator>
#include<vector>
#include<algorithm>
#include<string>
#include<numeric>
using namespace std;


int main(){
int c;
cin>>c;
long long int arr[c];
for(int k=0;k<c;k++){
    long long int x,y,z,p,m=0;
    cin>>x>>y>>z;
    vector<long long int>vec;
    vector<long long int>vec1;
    vector<long long int>vec2;
    for(long long j=0;j<x;j++){
        cin>>p;
        vec.push_back(p);
    }
    for(long long j=0;j<=z-1;j++){
        p=vec[j];
        vec1.push_back(p);
    }
    for(long long j=y-1;j<x;j++){
        p=vec[j];
        vec2.push_back(p);
    }
    sort(vec2.begin(),vec2.end());
    sort(vec1.begin(),vec1.end());
    z=z-y+1;
    x=0;
    y=0;
    for(long long j=0;j<z;j++){
        x+=vec1[j];
        y+=vec2[j];
    }
    z=min(y,x);
    arr[k]=z;
}
for(int k=0;k<c;k++){
    cout<<arr[k]<<endl;
}
}
Problem: 2063B - Subsequence Update
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Compilation error):
#include<iostream>
#include<bitset>
#include<utility>
#include<cmath>
#include<iterator>
#include<vector>
#include<algorithm>
#include<string>
#include<numeric>
using namespace std;


int main(){
int c;
cin>>c;
long long int arr[c];
for(int k=0;k<c;k++){
    long long int x,y,z,p,m=0;
    cin>>x>>y>>z;
    vector<long long int>vec;
    for(long long j=0;j<x;j++){
        cin>>p;
        vec.push_back(p);
    }
    sort(vec.begin(),vec.end());
    z=z-y+1
    z=min(z,x);
     for(long long int j=0;j<z;j++){
        m+=vec[j];
    }
    arr[k]=m;
}
for(int k=0;k<c;k++){
    cout<<arr[k]<<endl;
}
}
Problem: 2063B - Subsequence Update
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Compilation error):
#include<iostream>
#include<bitset>
#include<utility>
#include<cmath>
#include<iterator>
#include<vector>
#include<algorithm>
#include<string>
#include<numeric>
using namespace std;


int main(){
int c;
cin>>c;
long long int arr[c];
for(int k=0;k<c;k++){
    long long int x,y,z,p,m=0;
    cin>>x>>y>>z;
    vector<long long int>vec;
    for(long long j=0;j<x;j++){
        cin>>p;
        vec.push_back(p);
    }
    sort(vec.begin(),vec.end());
    z=z-y+1
    z=min(z,x);
     for(long long int j=0;j<z;j++){
        m+=vec[j];
    }
    arr[k]=m;
}
for(int k=0;k<c;k++){
    cout<<arr[k]<<endl;
}
}

Submission (verdict: Wrong answer on test 2):
#include<iostream>

#include<bitset>

#include<utility>

#include<cmath>

#include<iterator>

#include<vector>

#include<algorithm>

#include<string>

#include<numeric>

using namespace std;





int main(){

int c;

cin>>c;

long long int arr[c];

for(int k=0;k<c;k++){

    long long int x,y,z,p,m=0;

    cin>>x>>y>>z;

    vector<long long int>vec;

    for(long long j=0;j<x;j++){

        cin>>p;

        vec.push_back(p);

    }

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

    z=z-y+1;

    z=min(z,x);

     for(long long int j=0;j<z;j++){

        m+=vec[j];

    }

    arr[k]=m;

}

for(int k=0;k<c;k++){

    cout<<arr[k]<<endl;

}

}