ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2052A - Adrenaline Rush
Language: C++23 (GCC 14-64, msys2)

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/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;

#define rep(n) for (int _i_i_ = (n); _i_i_; --_i_i_)
#define mem(arr, x) memset((arr), x, sizeof (arr))
#define mkp make_pair
#define edge(y, x, ver) for (int _i_ = h[x], y = ver[_i_]; _i_; y = ver[_i_ = nxt[_i_]])
#define import mt19937
#define random rnd(chrono::system_clock::now().time_since_epoch().count())
#define setdb(v) setprecision(v)
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int maxn = 1e5 + 5;

int n;
int c, vis[maxn];

void solve() {
	cin >> n;
	vector<pii> ans;
	for (int i = 1; i <= n; ++i) {
		cin >> c;
		vis[c] = 1;
		for (int j = c + 1; j <= n; ++j) {
			ans.emplace_back(j, c);
			if (!vis[j]) ans.emplace_back(c, j);
		}
	}
	cout << ans.size() << '\n';
	for (auto &[x, y] : ans) cout << x << ' ' << y << '\n';
}

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
	int t = 1;
	//cin >> t;
	rep (t) {
		solve();
	}
	return 0;
}

/*
+---------------------------------------------+
|GREY|GREEN|CYAN|BLUE|PURPLE|YELLOW|ORANGE|RED|
+---------------------------------------------+
*/

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/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;

#define rep(n) for (int _i_i_ = (n); _i_i_; --_i_i_)
#define mem(arr, x) memset((arr), x, sizeof (arr))
#define mkp make_pair
#define edge(y, x, ver) for (int _i_ = h[x], y = ver[_i_]; _i_; y = ver[_i_ = nxt[_i_]])
#define import mt19937
#define random rnd(chrono::system_clock::now().time_since_epoch().count())
#define setdb(v) setprecision(v)
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int maxn = 1e3 + 5;

int n;
int c, p[maxn];

void solve() {
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> c;
		p[c] = i;
	}
	vector<pii> ans;
	for (int i = 1; i <= n; ++i) {
		for (int j = i + 1; j <= n; ++j) {
			ans.emplace_back(j, i);
			if (p[i] < p[j]) ans.emplace_back(i, j);
		}
	}
	cout << ans.size() << '\n';
	for (auto &[x, y] : ans) cout << x << ' ' << y << '\n';
}

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
	int t = 1;
	//cin >> t;
	rep (t) {
		solve();
	}
	return 0;
}

/*
+---------------------------------------------+
|GREY|GREEN|CYAN|BLUE|PURPLE|YELLOW|ORANGE|RED|
+---------------------------------------------+
*/
Problem: 2052A - Adrenaline Rush
Language: C++23 (GCC 14-64, msys2)

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/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;

#define rep(n) for (int _i_i_ = (n); _i_i_; --_i_i_)
#define mem(arr, x) memset((arr), x, sizeof (arr))
#define mkp make_pair
#define edge(y, x, ver) for (int _i_ = h[x], y = ver[_i_]; _i_; y = ver[_i_ = nxt[_i_]])
#define import mt19937
#define random rnd(chrono::system_clock::now().time_since_epoch().count())
#define setdb(v) setprecision(v)
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int maxn = 1e3 + 5;

int n;
int c, p[maxn];

void solve() {
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> c;
		p[c] = i;
	}
	vector<pii> ans;
	for (int i = 1; i <= n; ++i) {
		for (int j = i + 1; j <= n; ++j) {
			ans.emplace_back(j, i);
			if (p[i] < p[j]) ans.emplace_back(i, j);
		}
	}
	cout << ans.size() << '\n';
	for (auto &[x, y] : ans) cout << x << ' ' << y << '\n';
}

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
	int t = 1;
	//cin >> t;
	rep (t) {
		solve();
	}
	return 0;
}

/*
+---------------------------------------------+
|GREY|GREEN|CYAN|BLUE|PURPLE|YELLOW|ORANGE|RED|
+---------------------------------------------+
*/

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/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;

#define rep(n) for (int _i_i_ = (n); _i_i_; --_i_i_)
#define mem(arr, x) memset((arr), x, sizeof (arr))
#define mkp make_pair
#define edge(y, x, ver) for (int _i_ = h[x], y = ver[_i_]; _i_; y = ver[_i_ = nxt[_i_]])
#define import mt19937
#define random rnd(chrono::system_clock::now().time_since_epoch().count())
#define setdb(v) setprecision(v)
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int maxn = 1e3 + 5;

int n;
int c, p[maxn];

void solve() {
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> c;
		p[c] = i;
	}
	vector<pii> ans;
	for (int i = 1; i <= n; ++i) {
		for (int j = i + 1; j <= n; ++j) {
			ans.emplace_back(j, i);
			if (p[i] < p[j]) ans.emplace_back(i, j);
		}
	}
	cout << ans.size() << '\n';
	for (auto &[x, y] : ans) cout << x << ' ' << y << '\n';
}

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
	int t = 1;
	//cin >> t;
	rep (t) {
		solve();
	}
	return 0;
}

/*
+---------------------------------------------+
|GREY|GREEN|CYAN|BLUE|PURPLE|YELLOW|ORANGE|RED|
+---------------------------------------------+
*/
Problem: 2052A - Adrenaline Rush
Language: C++23 (GCC 14-64, msys2)


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/contest/2052/problem/A
// Memory Limit: 1024 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;

#define rep(n) for (int _i_i_ = (n); _i_i_; --_i_i_)
#define mem(arr, x) memset((arr), x, sizeof (arr))
#define mkp make_pair
#define edge(y, x, ver) for (int _i_ = h[x], y = ver[_i_]; _i_; y = ver[_i_ = nxt[_i_]])
#define import mt19937
#define random rnd(chrono::system_clock::now().time_since_epoch().count())
#define setdb(v) setprecision(v)
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int maxn = 1e5 + 5;

int n;
int c, vis[maxn];

void solve() {
	cin >> n;
	vector<pii> ans;
	for (int i = 1; i <= n; ++i) {
		cin >> c;
		vis[c] = 1;
		for (int j = c + 1; j <= n; ++j) {
			ans.emplace_back(j, c);
			if (!vis[j]) ans.emplace_back(c, j);
		}
	}
	cout << ans.size() << '\n';
	for (auto &[x, y] : ans) cout << x << ' ' << y << '\n';
}

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
	int t = 1;
	//cin >> t;
	rep (t) {
		solve();
	}
	return 0;
}

/*
+---------------------------------------------+
|GREY|GREEN|CYAN|BLUE|PURPLE|YELLOW|ORANGE|RED|
+---------------------------------------------+
*/
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
﻿#define  _CRT_SECURE_NO_WARNINGS 1

#include <math.h>
#include <iostream>
#include <cstring>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <bitset>

using namespace std;

#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define INF 2e9
#define maxn 100005
#define eps 1e-8
const int mod = 998244353;

#define Neg -2147483647
#define Pos 2147483647

#define YES cout<<"Yes\n"
#define NO cout<<"No\n"
#define el '\n'

int l, r;

void ans(int a, int b, int c) {
	cout << (a ^ b) + (b ^ c) + (c ^ a) << el;
}

int len(int x) {
	int p = 0;
	while ((x >> 1) >= (1 << p))
		p++;
	return p;
}

int neg(int x) {
	for (int i = len(x); i >= 0; i--) {
		if (((x>>i)&1) == 1) x -= (1 << i);
		else x += (1 << i);
	}
	return x;
}

bool check(int x)
{
	return x <= r && x >= l;
}

void solve()
{

	cin >> l >> r;
	if (r - l == 2) {
		cout << l << " " << r - 1 << " " << r << el;
		return;
	}
	if (l == 0) {
		cout << 0 <<" " << neg(r)<< " " << r << el;
		return;
	}

	int a, b, c;
	int beg = (l >> len(l ^ r)) << len(l ^ r);
	a = beg + (1 << len(l ^ r));
	b = a - 1;
	c = check(a + 1) ? a + 1 : b - 1;
	
	cout << a << " " << b << " " << c << el;
}

int main()
{

	ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
	int _ = 1;
	cin >> _;
	for (int i = 0; i < _; i++)
	{
		solve();
	}

	return 0;
}

Submission (verdict: Accepted):
﻿#define  _CRT_SECURE_NO_WARNINGS 1

#include <math.h>
#include <iostream>
#include <cstring>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <bitset>

using namespace std;

#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define INF 2e9
#define maxn 100005
#define eps 1e-8
const int mod = 998244353;

#define Neg -2147483647
#define Pos 2147483647

#define YES cout<<"Yes\n"
#define NO cout<<"No\n"
#define el '\n'

int l, r;

void ans(int a, int b, int c) {
	cout << (a ^ b) + (b ^ c) + (c ^ a) << el;
}

int len(int x) {
	int p = 0;
	while ((x >> 1) >= (1 << p))
		p++;
	return p;
}

int neg(int x) {
	for (int i = len(x); i >= 0; i--) {
		if (((x>>i)&1) == 1) x -= (1 << i);
		else x += (1 << i);
	}
	return x;
}

bool check(int x)
{
	return x <= r && x >= l;
}

void solve()
{

	cin >> l >> r;
	if (r - l == 2) {
		cout << l << " " << r - 1 << " " << r << el;
		return;
	}


	int a, b, c;
	int beg = (l >> len(l ^ r)) << len(l ^ r);
	a = beg + (1 << len(l ^ r));
	b = a - 1;
	c = check(a + 1) ? a + 1 : b - 1;
	
	cout << a << " " << b << " " << c << el;
}

int main()
{

	ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
	int _ = 1;
	cin >> _;
	for (int i = 0; i < _; i++)
	{
		solve();
	}

	return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
﻿#define  _CRT_SECURE_NO_WARNINGS 1

#include <math.h>
#include <iostream>
#include <cstring>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <bitset>

using namespace std;

#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define INF 2e9
#define maxn 100005
#define eps 1e-8
const int mod = 998244353;

#define Neg -2147483647
#define Pos 2147483647

#define YES cout<<"Yes\n"
#define NO cout<<"No\n"
#define el '\n'

int l, r;

int len(int x) {
	int p = 0;
	while ((x >> 1) >= (1 << p))
		p++;
	return p;
}

int neg(int x) {
	for (int i = len(x); i >= 0; i--) {
		if (((x>>i)&1) == 1) x -= (1 << i);
		else x += (1 << i);
	}
	return x;
}

bool check(int x)
{
	return x <= r && x >= l;
}

void solve()
{
	cin >> l >> r;
	if (r - l == 2) {
		cout << l << " " << r - 1 << " " << r << el;
		return;
	}
	if (l == 0) {
		cout << 0 <<" " << neg(r)<< " " << r << el;
		return;
	}

	int res = 0;
	for (int i = len(r); i >= 0; i--) {
		if (((l & (1 << i)) != 0) ^ ((r & (1 << i)) != 0)) res += ((l >> i & 1) << i);
		else {
			if ((l & (1 << i)) != 0) {//俩1
				if (check(res)) continue;
				else res += (1 << i);
			}
			else {
				if (check(res + (1 << i))) res += (1 << i);
				else continue;
			}
		}
	}
	cout << l << " " << res << " " << r << el;
}

int main()
{

	ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
	int _ = 1;
	cin >> _;
	for (int i = 0; i < _; i++)
	{
		solve();
	}

	return 0;
}

Submission (verdict: Wrong answer on test 1):
﻿#define  _CRT_SECURE_NO_WARNINGS 1

#include <math.h>
#include <iostream>
#include <cstring>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <bitset>

using namespace std;

#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define INF 2e9
#define maxn 100005
#define eps 1e-8
const int mod = 998244353;

#define Neg -2147483647
#define Pos 2147483647

#define YES cout<<"Yes\n"
#define NO cout<<"No\n"
#define el '\n'

int l, r;

void ans(int a, int b, int c) {
	cout << (a ^ b) + (b ^ c) + (c ^ a) << el;
}

int len(int x) {
	int p = 0;
	while ((x >> 1) >= (1 << p))
		p++;
	return p;
}

int neg(int x) {
	for (int i = len(x); i >= 0; i--) {
		if (((x>>i)&1) == 1) x -= (1 << i);
		else x += (1 << i);
	}
	return x;
}

bool check(int x)
{
	return x <= r && x >= l;
}

void solve()
{

	cin >> l >> r;
	if (r - l == 2) {
		cout << l << " " << r - 1 << " " << r << el;
		return;
	}
	if (l == 0) {
		cout << 0 <<" " << neg(r)<< " " << r << el;
		return;
	}

	int a, b, c;
	int beg = (l >> len(l ^ r)) << len(l ^ r);
	a = beg + (1 << len(l ^ r));
	b = a - 1;
	c = check(a + 1) ? a + 1 : b - 1;
	
	cout << a << " " << b << " " << c << el;
}

int main()
{

	ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
	int _ = 1;
	cin >> _;
	for (int i = 0; i < _; i++)
	{
		solve();
	}

	return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
﻿#define  _CRT_SECURE_NO_WARNINGS 1

#include <math.h>
#include <iostream>
#include <cstring>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <bitset>

using namespace std;

#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define INF 2e9
#define maxn 100005
#define eps 1e-8
const int mod = 998244353;

#define Neg -2147483647
#define Pos 2147483647

#define YES cout<<"Yes\n"
#define NO cout<<"No\n"
#define el '\n'

int l, r;

int len(int x) {
	int p = 0;
	while ((x >> 1) >= (1 << p))
		p++;
	return p;
}

int neg(int x) {
	for (int i = len(x); i >= 0; i--) {
		if (((x>>i)&1) == 1) x -= (1 << i);
		else x += (1 << i);
	}
	return x;
}

bool check(int x)
{
	return x <= r && x >= l;
}

void solve()
{
	cin >> l >> r;
	if (r - l == 2) {
		cout << l << " " << r - 1 << " " << r << el;
		return;
	}
	if (l == 0) {
		cout << 0 <<" " << neg(r)<< " " << r << el;
		return;
	}

	int res = 0;
	for (int i = len(r); i >= 0; i--) {
		if (((l & (1 << i)) != 0) ^ ((r & (1 << i)) != 0)) res += ((l >> i & 1) << i);
		else {
			if ((l & (1 << i)) != 0) {//俩1
				if (check(res)) continue;
				else res += (1 << i);
			}
			else {
				if (check(res + (1 << i))) res += (1 << i);
				else continue;
			}
		}
	}
	cout << l << " " << res << " " << r << el;
}

int main()
{

	ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
	int _ = 1;
	cin >> _;
	for (int i = 0; i < _; i++)
	{
		solve();
	}

	return 0;
}
Problem: 2049C - MEX Cycle
Language: C++17 (GCC 7-32)

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



using namespace std;



using ll = long long;

#define mp(a,b) make_pair(a,b)



void colveI(){

    int n,x,y;

    cin>>n>>x>>y;

    x--; y--;

    vector<ll> v(n);

    for(int i=0;i<n;i++) v[i] = i%2;

    if(n%2==1) v[v.size()-1] = 2;

    // for(auto e: v) cout<<e<<" "; cout<<endl;

    if(v[x]==v[y] && y==v.size()-1 &&x==v.size()-3){

        for(int i=0;i<n;i++) v[i] = !(i%2);

        v[v.size()-1]=2;



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

            if(i==n-1) cout<<v[i]<<'\n';

            else cout<<v[i]<<" ";

        }

        return;

    }

    if(v[x]==v[y]){

        if(x==0 && v[v.size()-1]){

            v[0] = 2;

            v[v.size()-1]=0;

        }

        else{

            v[x+1]=2;

            int prev=v[x];

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

                if(prev==0){

                    v[i] = 1;

                    prev=1;

                }else{

                    v[i] = 0;

                    prev = 0;

                }

            }

            if(v[v.size()-1]==0) v[v.size()-1]=2;

        }

    }

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

        if(i==n-1) cout<<v[i]<<'\n';

        else cout<<v[i]<<" ";

    }

}



int main(){

	ios_base::sync_with_stdio(false);

    cin.tie(0);

    int t; cin>>t;

    while(t--) colveI();

}

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



using namespace std;



using ll = long long;

#define mp(a,b) make_pair(a,b)



void colveI(){

    int n,x,y;

    cin>>n>>x>>y;

    x--; y--;

    vector<ll> v(n);

    for(int i=0;i<n;i++) v[(x+i)%n] = i%2;

    if(n%2==1 || y-x%2==0) v[x]=2;

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

        if(i==n-1) cout<<v[i]<<'\n';

        else cout<<v[i]<<" ";

    }

}



int main(){

	ios_base::sync_with_stdio(false);

    cin.tie(0);

    int t; cin>>t;

    while(t--) colveI();

}
Problem: 2049C - MEX Cycle
Language: C++17 (GCC 7-32)


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



using namespace std;



using ll = long long;

#define mp(a,b) make_pair(a,b)



void colveI(){

    int n,x,y;

    cin>>n>>x>>y;

    x--; y--;

    vector<ll> v(n);

    for(int i=0;i<n;i++) v[i] = i%2;

    if(n%2==1) v[v.size()-1] = 2;

    // for(auto e: v) cout<<e<<" "; cout<<endl;

    if(v[x]==v[y]){

        if(x==0 && v[v.size()-1]){

            v[0] = 2;

            v[v.size()-1]=0;

        }

        else{

            v[x+1]=2;

            int prev=v[x];

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

                if(prev==0){

                    v[i] = 1;

                    prev=1;

                }else{

                    v[i] = 0;

                    prev = 0;

                }

            }

            if(v[v.size()-1]==0) v[v.size()-1]=2;

        }

    }

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

        if(i==n-1) cout<<v[i]<<'\n';

        else cout<<v[i]<<" ";

    }

}



int main(){

	ios_base::sync_with_stdio(false);

    cin.tie(0);

    int t; cin>>t;

    while(t--) colveI();

}
Problem: 2049C - MEX Cycle
Language: C++17 (GCC 7-32)

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



using namespace std;



using ll = long long;

#define mp(a,b) make_pair(a,b)



void colveI(){

    int n,x,y;

    cin>>n>>x>>y;

    x--; y--;

    vector<ll> v(n);

    for(int i=0;i<n;i++) v[(x+i)%n] = i%2;

    if(n%2==1 || y-x%2==0) v[x]=2;

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

        if(i==n-1) cout<<v[i]<<'\n';

        else cout<<v[i]<<" ";

    }

}



int main(){

	ios_base::sync_with_stdio(false);

    cin.tie(0);

    int t; cin>>t;

    while(t--) colveI();

}

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

using namespace std;

using ll = long long;

void colveI(){

    int n,x,y;

    cin>>n>>x>>y;

    x--; y--;

    vector<ll> v(n);

    for(int i=0;i<n;i++) v[(x+i)%n] = i%2;

    if(n%2==1 || (y-x)%2==0) v[x]=2;

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

        if(i==n-1) cout<<v[i]<<'\n';

        else cout<<v[i]<<" ";

    }

}

int main(){

	ios_base::sync_with_stdio(false);

    cin.tie(0);

    int t; cin>>t;

    while(t--) colveI();

}
Problem: 2049C - MEX Cycle
Language: C++17 (GCC 7-32)

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



using namespace std;



using ll = long long;

#define mp(a,b) make_pair(a,b)



void colveI(){

    int n,x,y;

    cin>>n>>x>>y;

    x--; y--;

    vector<ll> v(n);

    for(int i=0;i<n;i++) v[i] = i%2;

    if(n%2==1) v[v.size()-1] = 2;

    // for(auto e: v) cout<<e<<" "; cout<<endl;

    if(v[x]==v[y]){

        if(x==0 && v[v.size()-1]){

            v[0] = 2;

            v[v.size()-1]=0;

        }

        else{

            v[x+1]=2;

            int prev=v[x];

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

                if(prev==0){

                    v[i] = 1;

                    prev=1;

                }else{

                    v[i] = 0;

                    prev = 0;

                }

            }

            if(v[v.size()-1]==0) v[v.size()-1]=2;

        }

    }

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

        if(i==n-1) cout<<v[i]<<'\n';

        else cout<<v[i]<<" ";

    }

}



int main(){

	ios_base::sync_with_stdio(false);

    cin.tie(0);

    int t; cin>>t;

    while(t--) colveI();

}

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



using namespace std;



using ll = long long;

#define mp(a,b) make_pair(a,b)



void colveI(){

    int n,x,y;

    cin>>n>>x>>y;

    x--; y--;

    vector<ll> v(n);

    for(int i=0;i<n;i++) v[i] = i%2;

    if(n%2==1) v[v.size()-1] = 2;

    // for(auto e: v) cout<<e<<" "; cout<<endl;

    if(v[x]==v[y] && y==v.size()-1 &&x==v.size()-3){

        for(int i=0;i<n;i++) v[i] = !(i%2);

        v[v.size()-1]=2;



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

            if(i==n-1) cout<<v[i]<<'\n';

            else cout<<v[i]<<" ";

        }

        return;

    }

    if(v[x]==v[y]){

        if(x==0 && v[v.size()-1]){

            v[0] = 2;

            v[v.size()-1]=0;

        }

        else{

            v[x+1]=2;

            int prev=v[x];

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

                if(prev==0){

                    v[i] = 1;

                    prev=1;

                }else{

                    v[i] = 0;

                    prev = 0;

                }

            }

            if(v[v.size()-1]==0) v[v.size()-1]=2;

        }

    }

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

        if(i==n-1) cout<<v[i]<<'\n';

        else cout<<v[i]<<" ";

    }

}



int main(){

	ios_base::sync_with_stdio(false);

    cin.tie(0);

    int t; cin>>t;

    while(t--) colveI();

}
Problem: 2060D - Subtract Min Sort
Language: C++23 (GCC 14-64, msys2)

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

using namespace std;



void solve() {

    int n;

    cin >> n;

    int a[n + 1];

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

        cin >> a[i];

    }

    int x1 = a[1];

    int x2 = a[2];

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

        int x = min(x1, x2);

        x1 -= x;

        x2 -= x;

        x1 = x2;

        x2 = a[i + 1];

        if (x1 > x2) {

            cout << "no" << endl;

            return;

        }

    }

    cout << "yes" << endl;

}



int main() {

    int t;

    cin >> t;

    while (t--) {

        solve();

    }

    return 0;

}







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

using namespace std;

#define int long long



void solve() {

    int n;

    cin >> n;

    int a[n + 1];

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

        cin >> a[i];

    }

    int x1 = a[1];

    int x2 = a[2];

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

        int x = min(x1, x2);

        x1 -= x;

        x2 -= x;

        x1 = x2;

        x2 = a[i + 1];

        if (x1 > x2) {

            cout << "no" << endl;

            return;

        }

    }

    cout << "yes" << endl;

}



signed main() {

    int t;

    cin >> t;

    while (t--) {

        solve();

    }

    return 0;

}