ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
const int N=2e5+7;

void solved(){
    int  l,r;cin>>l>>r;
    int flag=0;
    int a=0,b=0,c=0;
    for(int i=30;i>=0;i--){
        int x=(l>>i)&1;
        int y=(r>>i)&1;
        int t=(1ll<<i);
        if(x==1 and y==1 and flag==0){
            a+=t;
            b+=t;
            c+=t;
            continue;
        }
        if((x==1 or y==1) and flag==0){
            flag=1;
            a+=t;
            b+=0;
            c+=0;
            continue;
        }
        if(flag){
            a+=0;
            b+=t;
            c+=t;
        }
    }
    if(b==c){
        if(a==b+1){
            a++;
            b++;
        }else{
            c--;
        }
        
    }
    cout<<a<<" "<<b<<" "<<c<<'\n';
}

signed main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int _=1;
    cin>>_;
    while(_--)solved();
}


Submission (verdict: Wrong answer on test 2):
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
const int N=2e5+7;

void solved(){
    int  l,r;cin>>l>>r;
    int flag=0;
    int a=0,b=0,c=0;
    for(int i=30;i>=0;i--){
        int x=(l>>i)&1;
        int y=(r>>i)&1;
        int t=(1ll<<i);
        if(x==1 and y==1 and flag==0){
            a+=t;
            b+=t;
            c+=t;
            continue;
        }
        if((x==1 or y==1) and flag==0){
            flag=1;
            a+=t;
            b+=0;
            c+=0;
            continue;
        }
        if(flag){
            a+=0;
            b+=t;
            c+=t;
        }
    }
    if(r-l==2){
        cout<<l<<" "<<l+1<<" "<<l+2<<'\n';
        return;
    }
    if(b==c){
        c--;
    }
    cout<<a<<" "<<b<<" "<<c<<'\n';
}

signed main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int _=1;
    cin>>_;
    while(_--)solved();
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 1):
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
const int N=2e5+7;

void solved(){
    int  l,r;cin>>l>>r;
    int flag=0;
    int a=0,b=0,c=0;
    for(int i=30;i>=0;i--){
        int x=(l>>i)&1;
        int y=(r>>i)&1;
        int t=(1ll<<i);
        if(x==1 and y==1 and flag==0){
            a+=t;
            b+=t;
            c+=t;
            continue;
        }
        if((x==1 or y==1) and flag==0){
            flag=1;
            a+=t;
            b+=0;
            c+=0;
            continue;
        }
        if(flag){
            a+=0;
            b+=t;
            c+=t;
        }
    }
    if(b==c){
        if(a==b+1){
            a++;
            b++;
        }else{
            c--;
        }
        
    }
    cout<<a<<" "<<b<<" "<<c<<'\n';
}

signed main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int _=1;
    cin>>_;
    while(_--)solved();
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
const int N=2e5+7;

void solved(){
    int  l,r;cin>>l>>r;
    int flag=0;
    int a=0,b=0,c=0;
    for(int i=30;i>=0;i--){
        int x=(l>>i)&1;
        int y=(r>>i)&1;
        int t=(1ll<<i);
        if(x==1 and y==1 and flag==0){
            a+=t;
            b+=t;
            c+=t;
            continue;
        }
        if((x==1 or y==1) and flag==0){
            flag=1;
            a+=t;
            b+=0;
            c+=0;
            continue;
        }
        if(flag){
            a+=0;
            b+=t;
            c+=t;
        }
    }
    if(r-l==2){
        cout<<l<<" "<<l+1<<" "<<l+2<<'\n';
        return;
    }
    if(b==c){
        c--;
    }
    cout<<a<<" "<<b<<" "<<c<<'\n';
}

signed main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int _=1;
    cin>>_;
    while(_--)solved();
}


Submission (verdict: Accepted):
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
const int N=2e5+7;

void solved(){
    int  l,r;cin>>l>>r;
    int flag=0;
    int a=0,b=0,c=0;
    for(int i=30;i>=0;i--){
        int x=(l>>i)&1;
        int y=(r>>i)&1;
        int t=(1ll<<i);
        if(x==1 and y==1 and flag==0){
            a+=t;
            b+=t;
            c+=t;
            continue;
        }
        if((x==1 or y==1) and flag==0){
            flag=1;
            a+=t;
            b+=0;
            c+=0;
            continue;
        }
        if(flag){
            a+=0;
            b+=t;
            c+=t;
        }
    }
    if(r-l==2){
        cout<<l<<" "<<l+1<<" "<<l+2<<'\n';
        return;
    }
    if(b==c){
        if(c-1<l){
            a++;
            b++;
        }else{
            c--;
        }
    }
    cout<<a<<" "<<b<<" "<<c<<'\n';
}

signed main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int _=1;
    cin>>_;
    while(_--)solved();
}
Problem: 2060D - Subtract Min Sort
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Compilation error):
#include "stdc++.h"

#define ll long long 

#define fastCode ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;



void code()

{

    ll n;

    cin >> n;

    unordered_set<int>v;

    int x;

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

    {

        cin >> x;

        v.insert(x);

    }



    if (v.size() < 2)

    {

        cout << "NO" << endl;

        return;

    }



    auto temp = v.begin();

    int first = *temp;

    temp++;

    int second = *temp;

    int mini = min(first, second);



    vector<int>res;

    int count = 0;

    for (auto i : v)

    {

        count++;

        int def = abs(i - mini);

        res.push_back(def);

        if (count == 2)

            break;

    }

    count = 0;

    for (auto i : v)

    {

        count++;

        int def = abs(i - mini);

        if (count == 2)

        {

            res.push_back(def);

        }

    }

    vector<int> ressort = res;

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

    if (res != ressort)

    {

        cout << "NO" << endl;

    }

    else

        cout << "YES" << endl;



}



int main()

{

    fastCode

        ll t = 1;

    cin >> t;

    while (t--)

    {

        code();

    }

}
Problem: 2049C - MEX Cycle
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
/**

you can ^_^ (•‿•)

( إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما )

**/

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/hash_policy.hpp>

// #pragma GCC optimize("Ofast")

// #pragma GCC target("avx,avx2,fma")

// #pragma GCC optimization ("unroint-loops")

// #include "robin_hood.h"

using namespace __gnu_pbds;

using namespace std;

typedef long long ll;

typedef unsigned long long ul;

typedef tree<pair <ll, ll>, null_type, greater<pair <ll, ll>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define endl "\n"

const int mod = 998244353;

const int dx[] = {1, -1, 0, 0};

const int dy[] = {0, 0, 1, -1};

void fast(){ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 2e5 + 5;



void Solve() {

    int n, x, y; cin >> n >> x >> y;

    vector <int> ans(n + 1);

    ans[x] = 2;

    ans[y] = 1;

    for (int i = 1; i < x; i++) ans[i] = ans[i > 1 ? i - 1 : n] == 0 ? 1 : 0;

    for (int i = x + 1; i < y; i++) ans[i] = ans[i > 1 ? i - 1 : n] == 0 ? 1 : 0;

    for (int i = y + 1; i < n + 1; i++) ans[i] = ans[i > 1 ? i - 1 : n] == 0 ? 1 : 0;

    for (int i = 1; i <= n; i++) cout << ans[i] << " ";

    cout << endl;

}



signed main() {

    fast();

    int t = 1; cin >> t;

    while (t--) Solve();

}

/**

you can ^_^ (•‿•)

( إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما )

**/

Submission (verdict: Wrong answer on test 1):
/**

you can ^_^ (•‿•)

( إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما )

**/

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/hash_policy.hpp>

// #pragma GCC optimize("Ofast")

// #pragma GCC target("avx,avx2,fma")

// #pragma GCC optimization ("unroint-loops")

// #include "robin_hood.h"

using namespace __gnu_pbds;

using namespace std;

typedef long long ll;

typedef unsigned long long ul;

typedef tree<pair <ll, ll>, null_type, greater<pair <ll, ll>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define endl "\n"

const int mod = 998244353;

const int dx[] = {1, -1, 0, 0};

const int dy[] = {0, 0, 1, -1};

void fast(){ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 2e5 + 5;



void Solve() {

    int n, x, y; cin >> n >> x >> y;

    vector <int> ans(n + 1);

    ans[x] = 2;

    ans[y] = 1;

    for (int i = y + 1; i <= n; i++) ans[i] = ans[i - 1] == 0 ? 1 : 0;

    for (int i = 1; i < x; i++) ans[i] = ans[i > 1 ? i - 1 : n] == 0 ? 1 : 0;

    for (int i = y - 1; i > x; i--) ans[i] = ans[i + 1] == 0 ? 1 : 0;

    for (int i = 1; i <= n; i++) cout << ans[i] << " ";

    cout << endl;

}



signed main() {

    fast();

    int t = 1; cin >> t;

    while (t--) Solve();

}

/**

you can ^_^ (•‿•)

( إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما )

**/
Problem: 2049C - MEX Cycle
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
/**

you can ^_^ (•‿•)

( إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما )

**/

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/hash_policy.hpp>

// #pragma GCC optimize("Ofast")

// #pragma GCC target("avx,avx2,fma")

// #pragma GCC optimization ("unroint-loops")

// #include "robin_hood.h"

using namespace __gnu_pbds;

using namespace std;

typedef long long ll;

typedef unsigned long long ul;

typedef tree<pair <ll, ll>, null_type, greater<pair <ll, ll>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define endl "\n"

const int mod = 998244353;

const int dx[] = {1, -1, 0, 0};

const int dy[] = {0, 0, 1, -1};

void fast(){ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 2e5 + 5;



void Solve() {

    int n, x, y; cin >> n >> x >> y;

    vector <int> ans(n + 1);

    ans[x] = 2;

    ans[y] = 1;

    for (int i = y + 1; i <= n; i++) ans[i] = ans[i - 1] == 0 ? 1 : 0;

    for (int i = 1; i < x; i++) ans[i] = ans[i > 1 ? i - 1 : n] == 0 ? 1 : 0;

    for (int i = y - 1; i > x; i--) ans[i] = ans[i + 1] == 0 ? 1 : 0;

    for (int i = 1; i <= n; i++) cout << ans[i] << " ";

    cout << endl;

}



signed main() {

    fast();

    int t = 1; cin >> t;

    while (t--) Solve();

}

/**

you can ^_^ (•‿•)

( إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما )

**/

Submission (verdict: Accepted):
/**

you can ^_^ (•‿•)

( إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما )

**/

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/hash_policy.hpp>

// #pragma GCC optimize("Ofast")

// #pragma GCC target("avx,avx2,fma")

// #pragma GCC optimization ("unroint-loops")

// #include "robin_hood.h"

using namespace __gnu_pbds;

using namespace std;

typedef long long ll;

typedef unsigned long long ul;

typedef tree<pair <ll, ll>, null_type, greater<pair <ll, ll>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define endl "\n"

const int mod = 998244353;

const int dx[] = {1, -1, 0, 0};

const int dy[] = {0, 0, 1, -1};

void fast(){ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 2e5 + 5;



void Solve() {

    int n, x, y; cin >> n >> x >> y;

    vector <int> ans(n + 1);

    ans[x] = (n - y + x - 1) % 2 || (y - x - 1) % 2 ? 2 : 0;

    ans[y] = 1;

    for (int i = y + 1; i <= n; i++) ans[i] = ans[i - 1] == 0 ? 1 : 0;

    for (int i = 1; i < x; i++) ans[i] = ans[i > 1 ? i - 1 : n] == 0 ? 1 : 0;

    for (int i = y - 1; i > x; i--) ans[i] = ans[i + 1] == 0 ? 1 : 0;

    for (int i = 1; i <= n; i++) cout << ans[i] << " ";

    cout << endl;

}



signed main() {

    fast();

    int t = 1; cin >> t;

    while (t--) Solve();

}

/**

you can ^_^ (•‿•)

( إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما )

**/
Problem: 2049C - MEX Cycle
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 1):
/**

you can ^_^ (•‿•)

( إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما )

**/

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/hash_policy.hpp>

// #pragma GCC optimize("Ofast")

// #pragma GCC target("avx,avx2,fma")

// #pragma GCC optimization ("unroint-loops")

// #include "robin_hood.h"

using namespace __gnu_pbds;

using namespace std;

typedef long long ll;

typedef unsigned long long ul;

typedef tree<pair <ll, ll>, null_type, greater<pair <ll, ll>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define endl "\n"

const int mod = 998244353;

const int dx[] = {1, -1, 0, 0};

const int dy[] = {0, 0, 1, -1};

void fast(){ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 2e5 + 5;



void Solve() {

    int n, x, y; cin >> n >> x >> y;

    vector <int> ans(n + 1);

    ans[x] = 2;

    ans[y] = 1;

    for (int i = 1; i < x; i++) ans[i] = ans[i > 1 ? i - 1 : n] == 0 ? 1 : 0;

    for (int i = x + 1; i < y; i++) ans[i] = ans[i > 1 ? i - 1 : n] == 0 ? 1 : 0;

    for (int i = y + 1; i < n + 1; i++) ans[i] = ans[i > 1 ? i - 1 : n] == 0 ? 1 : 0;

    for (int i = 1; i <= n; i++) cout << ans[i] << " ";

    cout << endl;

}



signed main() {

    fast();

    int t = 1; cin >> t;

    while (t--) Solve();

}

/**

you can ^_^ (•‿•)

( إن الله وملائكته يصلون على النبي يا أيها الذين آمنوا صلوا عليه وسلموا تسليما )

**/
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)


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

int l,r;
int main() {
    ios::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
    int T;cin>>T;
    while(T--){
    	cin>>l>>r;
    	int a,b,c;
		for(int i=30;i>=0;i--){
			int p=1<<i;
			if((l&p)!=(r&p)){
				a=p;b=p-1;break;
			}
		}
		if(a+1<=r){
			c=a+1;
		}
		else{
			c=b-1;
		}
		cout<<a<<' '<<b<<' '<<c<<endl;
	}
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

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

int l,r;
int main() {
    ios::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
    int T;cin>>T;
    while(T--){
    	cin>>l>>r;
    	int a,b,c;
		for(int i=30;i>=0;i--){
			int p=1<<i;
			if((l&p)!=(r&p)){
				a=p;b=p-1;break;
			}
		}
		if(a+1<=r){
			c=a+1;
		}
		else{
			c=b-1;
		}
		cout<<a<<' '<<b<<' '<<c<<endl;
	}
    return 0;
}

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

int l,r;
int main() {
    ios::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
    int T;cin>>T;
    while(T--){
    	cin>>l>>r;
    	int a,b,c;
		for(int i=30;i>=0;i--){
			int p=1<<i;
			if((l&p)==(r&p)){
				a+=(l&p);b+=(r&p);
			}
			else{
				a+=p;b+=p-1;break;
			}
		}
		if(a+1<=r){
			c=a+1;
		}
		else{
			c=b-1;
		}
		cout<<a<<' '<<b<<' '<<c<<endl;
	}
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

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

int l,r;
int main() {
    ios::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
    int T;cin>>T;
    while(T--){
    	cin>>l>>r;
    	int a,b,c;
		for(int i=30;i>=0;i--){
			int p=1<<i;
			if((l&p)==(r&p)){
				a+=(l&p);b+=(r&p);
			}
			else{
				a+=p;b+=p-1;break;
			}
		}
		if(a+1<=r){
			c=a+1;
		}
		else{
			c=b-1;
		}
		cout<<a<<' '<<b<<' '<<c<<endl;
	}
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
#pragma optimzie(2)
#define ll long long
using namespace std;

int l,r;
int main() {
    ios::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
    int T;cin>>T;
    while(T--){
    	cin>>l>>r;
    	int a=0,b=0,c=0;
		for(int i=30;i>=0;i--){
			int p=1<<i;
			if((l&p)==(r&p)){
				a+=(l&p);b+=(r&p);
			}
			else{
				a+=p;b+=p-1;break;
			}
		}
		if(a+1<=r){
			c=a+1;
		}
		else{
			c=b-1;
		}
		cout<<a<<' '<<b<<' '<<c<<endl;
	}
    return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++20 (GCC 13-64)


Submission (verdict: Time limit exceeded on test 27):
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<bits/stdc++.h>
#include<string>
#include <numeric>
#include<map>
#include<set>
#include<iomanip>
using namespace std;
#define py cout << "YES" << endl
#define pn cout << "NO" << endl
#define ll long long
#define forw(i, j, n) for (ll i = j; i < n; i++)
#define fastio()                      \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)
#define pb push_back
#define ppb pop_back
#define all(x) x.begin(), x.end()
bool fun(ll x,unordered_map<ll,ll>&mp1,unordered_map<ll,bool>&mp2){
    if(x<=0)return false;
    if(mp2.count(x) && mp2[x]==false)return mp2[x];
    bool ans=true;
    if(mp1[x]>0){
        mp1[x]--;
        return true;
    }
    ll l,r;
    if(x%2){
        l=x/2;
        r=l+1;
    }
    else{
        l=x/2;
        r=x/2;
    }
        if(l==1){
            if(mp1[1]>0){
                mp1[1]--;
            }
            else ans=false;
            
        }
        else if(l==0){ans=false;}
        
       else ans&=fun(l,mp1,mp2);
    if(r==1){
         if(mp1[1]>0){
                mp1[1]--;
            }
            else ans=false;
    }
    else if(r==0){ans=false;}
    
    
        else ans&=fun(r,mp1,mp2);
    mp2[x]=ans;
    return ans;
}
int main() {
	int t; cin>>t;
	while(t--){
	    ll n,m; cin>>n>>m;
	    vector<ll> a(n),b(m);
	    unordered_map<ll,ll>mp1;
	    unordered_map<ll,bool>mp2;
	    forw(i,0,n){
	        cin>>a[i];
	  mp1[a[i]]++;
	    }
	     forw(i,0,m){
	        cin>>b[i];
	        
	    }
	   bool ans=true;
	   forw(i,0,m){
	       ans&=fun(b[i],mp1,mp2);
	       if(ans==false)break;
	   }
	for(auto it:mp1){
	    if(it.second>0){ans=false; break;}
	}
	    
	    
	               
	    if(ans)py;
	    else pn;
	}
	return 0;
}
// 1 1 1 1 1 2 2 2 2 2 3 3 3 3
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const int INF = 2e9;
int a[N];
void solve() {
	int n, l, r;
	ll sum = 0;
	scanf("%d%d%d", &n, &l, &r);
	for(int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
	}
	for(int i = l; i <= r; i++) {
		sum += a[i];
	}
	sort(a + 1, a + n + 1);
	ll ans = 0;
	for(int i = 1; i <= r - l + 1; i++) {
		ans += a[i];
	}
	if(ans == sum && n == 2 && r - l + 1 == 1) {
		ans += (a[r - l + 2] - a[r - l + 1]);
	}
	printf("%lld\n", ans);
}
int main() {
	// freopen("1.in", "r", stdin);
	// freopen("1.out", "w", stdout);
    int T = 1;
	scanf("%d", &T);
	while(T--) solve();

    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const int INF = 2e9;
int a[N];
void solve() {
	int n, l, r;
	scanf("%d%d%d", &n, &l, &r);
	for(int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
	}
	ll suml = 0, sumr = 0;
	priority_queue <int, vector<int>, greater<int> > ql, qr;
	for(int i = 1; i <= r; i++) {
		ql.push(a[i]);
	}
	for(int i = l; i <= r; i++) {
		suml += ql.top();
		ql.pop();
	}
	for(int i = l; i <= n; i++) {
		qr.push(a[i]);
	}
	for(int i = l; i <= r; i++) {
		sumr += qr.top();
		qr.pop();
	}
	printf("%lld\n", min(suml, sumr));
}
int main() {
	// freopen("1.in", "r", stdin);
	// freopen("1.out", "w", stdout);
    int T = 1;
	scanf("%d", &T);
	while(T--) solve();

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

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const int INF = 2e9;
int a[N];
void solve() {
	int n, l, r;
	ll sum = 0;
	scanf("%d%d%d", &n, &l, &r);
	for(int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
	}
	for(int i = l; i <= r; i++) {
		sum += a[i];
	}
	sort(a + 1, a + n + 1);
	ll ans = 0;
	for(int i = 1; i <= r - l + 1; i++) {
		ans += a[i];
	}
	if(ans == sum && r - l + 1 < n) {
		ans += a[r - l + 2] - a[r - l + 1];
	}
	printf("%lld\n", ans);
}
int main() {
	// freopen("1.in", "r", stdin);
	// freopen("1.out", "w", stdout);
    int T = 1;
	scanf("%d", &T);
	while(T--) solve();

    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const int INF = 2e9;
int a[N];
void solve() {
	int n, l, r;
	ll sum = 0;
	scanf("%d%d%d", &n, &l, &r);
	for(int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
	}
	for(int i = l; i <= r; i++) {
		sum += a[i];
	}
	sort(a + 1, a + n + 1);
	ll ans = 0;
	for(int i = 1; i <= r - l + 1; i++) {
		ans += a[i];
	}
	if(ans == sum && n == 2 && r - l + 1 == 1) {
		ans += (a[r - l + 2] - a[r - l + 1]);
	}
	printf("%lld\n", ans);
}
int main() {
	// freopen("1.in", "r", stdin);
	// freopen("1.out", "w", stdout);
    int T = 1;
	scanf("%d", &T);
	while(T--) solve();

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


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
const int INF = 2e9;
int a[N];
void solve() {
	int n, l, r;
	scanf("%d%d%d", &n, &l, &r);
	for(int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
	}
	sort(a + 1, a + n + 1);
	ll ans = 0;
	for(int i = 1; i <= r - l + 1; i++) {
		ans += a[i];
	}
	printf("%lld\n", ans);
}
int main() {
	// freopen("1.in", "r", stdin);
	// freopen("1.out", "w", stdout);
    int T = 1;
	scanf("%d", &T);
	while(T--) solve();

    return 0;
}