ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <vector>
using namespace std;

int n;
int c[1100];
int main()
{

    vector<pair<int, int>> ans;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> c[i];
    for (int i = 1; i < n; i++)
        if (c[i] < c[i + 1])
        {
            ans.push_back({c[i], c[i + 1]});
            ans.push_back({c[i + 1], c[i]});
        }
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n - i; j++)
        {
            if (c[j] > c[j + 1])
            {
                ans.push_back({c[j], c[j + 1]});
                swap(c[j], c[j + 1]);
            }
        }
    cout << ans.size() << endl;
    for (int i = 0; i < (int)ans.size(); i++)
        cout << ans[i].first << " " << ans[i].second << endl;

    system("pause");
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <vector>
using namespace std;

int n;
int c[1100];
int main()
{

    vector<pair<int, int>> ans;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> c[i];
    for (int i = 1; i < n; i++)
        if (c[i] < c[i + 1])
        {
            ans.push_back({c[i + 1], c[i]});
            ans.push_back({c[i], c[i + 1]});
        }
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n - i; j++)
        {
            if (c[j] > c[j + 1])
            {
                ans.push_back({c[j], c[j + 1]});
                swap(c[j], c[j + 1]);
            }
        }
    cout << ans.size() << endl;
    for (int i = 0; i < (int)ans.size(); i++)
        cout << ans[i].first << " " << ans[i].second << endl;

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

Previous submission (verdict: Wrong answer on test 4):
#include <iostream>
#include <vector>
using namespace std;

int n;
int c[1100];
int v[1100][1100] = {0};
int main()
{

    vector<pair<int, int>> ans;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> c[i];
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n - i; j++)
        {
            if (c[j] > c[j + 1])
            {
                ans.push_back({c[j], c[j + 1]});
                swap(c[j + 1], c[j]);
            }
            else if (v[c[j]][c[j + 1]] == 0)
            {
                ans.push_back({c[j], c[j + 1]});
                ans.push_back({c[j + 1], c[j]});
                v[c[j]][c[j + 1]] == 1;
            }
        }

    cout << ans.size() << endl;
    for (int i = (int)ans.size() - 1; i >= 0; i--)
        cout << ans[i].first << " " << ans[i].second << endl;

    system("pause");
    return 0;
}

Submission (verdict: Accepted):
#include <iostream>
#include <vector>
using namespace std;

int n;
int c[1100];
int v[1100][1100] = {0};
int main()
{

    vector<pair<int, int>> ans;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> c[i];
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n - i; j++)
        {
            if (c[j] < c[j + 1])
            {
                ans.push_back({c[j], c[j + 1]});
                swap(c[j + 1], c[j]);
            }
        }
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n - i; j++)
        {
            if (c[j] > c[j + 1])
            {
                ans.push_back({c[j], c[j + 1]});
                swap(c[j + 1], c[j]);
            }
        }
    cout << ans.size() << endl;
    for (int i = (int)ans.size() - 1; i >= 0; i--)
        cout << ans[i].first << " " << ans[i].second << endl;

    system("pause");
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <cmath>
using namespace std;

int t;
long long l, r;

int main()
{
    cin >> t;
    while (t--)
    {
        cin >> l >> r;
        int k = log2(r);
        long long pre = 0;
        while (((l >> k) & 1) == ((r >> k) & 1))
        {
            pre += ((l >> k) & 1) << k;
            k--;
        }

        long long x = pre + (1ll << k);
        long long y = x - 1;
        long long z;
        for (z = l; z <= r; z++)
            if (z != x && z != y)
                break;
        cout << x << " " << y << " " << z << endl;
    }

    system("pause");
    return 0;
}

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

void solve() {
    long long l, r;
    cin >> l >> r;
    long long a ;

    long long curr = 0;
   

    
    for (int i = 32; i >= 0; i--) {
        long long mask=(1LL << i);

        if ((l& mask)!=(r&mask )) { 
            curr|=mask;
            break;

        } 
        else{
            if(l&mask){
                curr|=mask;
            }
        }

    }
    long long curr2=curr-1;
   for (int i=l;i<=r;i++){
    if(i!=curr && i!=curr2){
        a=i;
        break;

    }
   }
   cout<<a<<" "<<curr<<" "<<curr2;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin >> t;
    while (t--) {
        solve();
        cout<<endl;
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <cmath>
using namespace std;

int t;
long long l, r;

int main()
{
    cin >> t;
    while (t--)
    {
        cin >> l >> r;
        int k = log2(r) + 1;
        while ((l >> (k - 1)) == (r >> (k - 1)))
            k--;
        long long x = 1ll << (k - 1);
        long long y = x - 1;
        long long z;
        for (z = l; z <= r; z++)
            if (z != x && z != y)
                break;
        cout << x << " " << y << " " << z << endl;
    }

    system("pause");
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <cmath>
using namespace std;

int t;
long long l, r;

int main()
{
    cin >> t;
    while (t--)
    {
        cin >> l >> r;
        int k = log2(r);
        long long pre = 0;
        while (((l >> k) & 1) == ((r >> k) & 1))
        {
            pre += ((l >> k) & 1) << k;
            k--;
        }

        long long x = pre + (1ll << k);
        long long y = x - 1;
        long long z;
        for (z = l; z <= r; z++)
            if (z != x && z != y)
                break;
        cout << x << " " << y << " " << z << endl;
    }

    system("pause");
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <cmath>
using namespace std;

int t;
long long l, r;

int main()
{
    cin >> t;
    while (t--)
    {
        cin >> l >> r;
        int k = log2(r) + 1;
        while ((l >> (k - 1)) == (r >> (k - 1)))
            k--;
        long long x = 1ll << (k - 1);
        long long y = x - 1;
        long long z;
        for (z = l; z <= r; z++)
            if (z != x && z != y)
                break;
        cout << x << " " << y << " " << z << endl;
    }

    system("pause");
    return 0;
}
Problem: 2063B - Subsequence Update
Language: C++20 (GCC 13-64)

Previous submission (verdict: Time limit exceeded on test 2):
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
/*
6
1 2
1 10
49 49
69 420
1 1
9982 44353
*/
int a[1000005];
signed main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		int m,l,r;
		cin>>m>>l>>r;
		memset(a,0,sizeof a);
		for(int j=1;j<=m;j++){
			cin>>a[j];
		}
		sort(a+1,a+1+m);
		int ans=0;
		for(int j=1;j<=r-l+1;j++){
			ans+=a[j];
		}
		cout<<ans<<endl;
	}
}

Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
/*
6
2 1 1
2 1
3 2 3
1 2 3
3 1 3
3 1 2
4 2 3
1 2 2 2

5 2 3
3 6 2 3 5

6 3 5
3 6 6 4 3 2
*/
int a[1000005],b[1000005];
signed main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		int m,l,r;
		cin>>m>>l>>r;
		for(int j=1;j<=m;j++){
			cin>>a[j];
			b[j]=a[j];
		}
		sort(a+1,a+r+1);
		sort(b+l,b+m+1);
		int ans=0,ans1=0;
//		for(int i=1;i<=m;i++) cout<<b[i]<<" ";
		for(int j=1;j<=r-l+1;j++){
			ans+=a[j];
//			cout<<a[j]<<" ";
		}
//		cout<<endl;
		for(int j=l;j<=l+r-1;j++){
			ans1+=b[j];
//			cout<<b[j]<<" ";
		}
//		cout<<endl;
		
		cout<<min(ans,ans1)<<endl;
	}
}
Problem: 2063B - Subsequence Update
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
/*
6
1 2
1 10
49 49
69 420
1 1
9982 44353
*/
int a[1000005];
signed main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		int n,l,r;
		cin>>n>>l>>r;
		for(int j=1;j<=n;j++){
			cin>>a[j];
		}
		sort(a+1,a+1+n);
		int ans=0;
		for(int j=1;j<=r-l+1;j++){
			ans+=a[j];
		}
		cout<<ans<<endl;
	}
}

Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
/*
6
1 2
1 10
49 49
69 420
1 1
9982 44353
*/
int a[1000005];
signed main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		int m,l,r;
		cin>>m>>l>>r;
		for(int j=1;j<=m;j++){
			cin>>a[j];
		}
		sort(a+1,a+1+m);
		int ans=0;
		for(int j=1;j<=r-l+1;j++){
			ans+=a[j];
		}
		cout<<ans<<endl;
	}
}
Problem: 2063B - Subsequence Update
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
/*
6
1 2
1 10
49 49
69 420
1 1
9982 44353
*/
int a[1000005];
signed main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		int n,l,r;
		cin>>n>>l>>r;
		for(int j=1;j<=n;j++){
			cin>>a[j];
		}
		sort(a+1,a+1+n);
		int ans=0;
		for(int j=1;j<=r-l+1;j++){
			ans+=a[j];
		}
		cout<<ans<<endl;
	}
}
Problem: 2063B - Subsequence Update
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
/*
6
1 2
1 10
49 49
69 420
1 1
9982 44353
*/
int a[1000005];
signed main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		int m,l,r;
		cin>>m>>l>>r;
		for(int j=1;j<=m;j++){
			cin>>a[j];
		}
		sort(a+1,a+1+m);
		int ans=0;
		for(int j=1;j<=r-l+1;j++){
			ans+=a[j];
		}
		cout<<ans<<endl;
	}
}

Submission (verdict: Time limit exceeded on test 2):
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
/*
6
1 2
1 10
49 49
69 420
1 1
9982 44353
*/
int a[1000005];
signed main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		int m,l,r;
		cin>>m>>l>>r;
		memset(a,0,sizeof a);
		for(int j=1;j<=m;j++){
			cin>>a[j];
		}
		sort(a+1,a+1+m);
		int ans=0;
		for(int j=1;j<=r-l+1;j++){
			ans+=a[j];
		}
		cout<<ans<<endl;
	}
}
Problem: 2063B - Subsequence Update
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
/*
6
2 1 1
2 1
3 2 3
1 2 3
3 1 3
3 1 2
4 2 3
1 2 2 2

5 2 3
3 6 2 3 5

6 3 5
3 6 6 4 3 2
*/
int a[1000005],b[1000005];
signed main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		int m,l,r;
		cin>>m>>l>>r;
		for(int j=1;j<=m;j++){
			cin>>a[j];
			b[j]=a[j];
		}
		sort(a+1,a+r+1);
		sort(b+l,b+m+1);
		int ans=0,ans1=0;
//		for(int i=1;i<=m;i++) cout<<b[i]<<" ";
		for(int j=1;j<=r-l+1;j++){
			ans+=a[j];
//			cout<<a[j]<<" ";
		}
//		cout<<endl;
		for(int j=l;j<=l+r-1;j++){
			ans1+=b[j];
//			cout<<b[j]<<" ";
		}
//		cout<<endl;
		
		cout<<min(ans,ans1)<<endl;
	}
}

Submission (verdict: Accepted):
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
/*
6
2 1 1
2 1
3 2 3
1 2 3
3 1 3
3 1 2
4 2 3
1 2 2 2

5 2 3
3 6 2 3 5

6 3 5
3 6 6 4 3 2
*/
int a[1000005],b[1000005];
/*
1
5 2 5
3 3 2 3 5
*/
signed main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		int m,l,r;
		cin>>m>>l>>r;
		for(int j=1;j<=m;j++){
			cin>>a[j];
			b[j]=a[j];
		}
		sort(a+1,a+r+1);
		sort(b+l,b+m+1);
		int ans=0,ans1=0;
		int len=r-l+1;
//		for(int j=1;j<=len;j++) cout<<a[j]<<" ";
//		for(int j=l;j<=len+l-1;j++) cout<<b[j]<<" ";
		for(int j=1;j<=len;j++) ans+=a[j];
		for(int j=l;j<=len+l-1;j++) ans1+=b[j];
		cout<<min(ans,ans1)<<endl;
	}
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)

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

// #define ONLINE_JUDGE 1
using namespace std;

int t = 1, n;
int a[1005];
vector<int> x,y;
void solve() {
    cin>>n;
    for(int i=0;i<n;i++) {
        cin>>a[i];
    }
    vector<int> nums(n);
    iota(nums.begin(), nums.end(), 1);
    for(int i = n - 1; i >= 0; i--) {
        int k = 0;
        while (k < n && nums[k] != a[i]) {
            k++;
        }
        
        for(int j = k - 1; j >= 0; j--) {
            x.push_back(nums[k]);
            y.push_back(nums[j]);
        }
        for(int j = 0; j < k; j++) {
            x.push_back(nums[j]);
            y.push_back(nums[k]);
        }
        for(int j = k + 1; j <= i; j++) {
            nums[j - 1] = nums[j];
            x.push_back(nums[j]);
            y.push_back(a[i]);
        }
        nums[i] = a[i];
    }
    cout<<x.size()<<endl;
    for(int i = 0; i < x.size(); i++) {
        cout<<x[i]<<" "<<y[i]<<endl;
    }
    x.clear();
    y.clear();
}


int main() {
    #ifdef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif

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

    // cin>>t;
    while(t-- > 0) {
        solve();
    }
    return 0;
}

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

// #define OPEN_FILE 1
using namespace std;

int t = 1, n;
int a[1005];
vector<int> x,y;
void solve() {
    cin>>n;
    for(int i=0;i<n;i++) {
        cin>>a[i];
    }
    vector<int> nums(n);
    iota(nums.begin(), nums.end(), 1);
    for(int i = n - 1; i >= 0; i--) {
        int k = 0;
        while (k < n && nums[k] != a[i]) {
            k++;
        }
        
        for(int j = k - 1; j >= 0; j--) {
            x.push_back(nums[k]);
            y.push_back(nums[j]);
        }
        for(int j = 0; j < k; j++) {
            x.push_back(nums[j]);
            y.push_back(nums[k]);
        }
        for(int j = k + 1; j <= i; j++) {
            nums[j - 1] = nums[j];
            x.push_back(nums[j]);
            y.push_back(a[i]);
        }
        nums[i] = a[i];
    }
    cout<<x.size()<<endl;
    for(int i = 0; i < x.size(); i++) {
        cout<<x[i]<<" "<<y[i]<<endl;
    }
    x.clear();
    y.clear();
}


int main() {
    #ifdef OPEN_FILE
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif

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

    // cin>>t;
    while(t-- > 0) {
        solve();
    }
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)


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

// #define ONLINE_JUDGE 1
using namespace std;

int t = 1, n;
int a[1005];
vector<int> x,y;
void solve() {
    cin>>n;
    for(int i=0;i<n;i++) {
        cin>>a[i];
    }
    vector<int> nums(n);
    iota(nums.begin(), nums.end(), 1);
    for(int i = n - 1; i >= 0; i--) {
        int k = 0;
        while (k < n && nums[k] != a[i]) {
            k++;
        }
        
        for(int j = k - 1; j >= 0; j--) {
            x.push_back(nums[k]);
            y.push_back(nums[j]);
        }
        for(int j = 0; j < k; j++) {
            x.push_back(nums[j]);
            y.push_back(nums[k]);
        }
        for(int j = k + 1; j <= i; j++) {
            nums[j - 1] = nums[j];
            x.push_back(nums[j]);
            y.push_back(a[i]);
        }
        nums[i] = a[i];
    }
    cout<<x.size()<<endl;
    for(int i = 0; i < x.size(); i++) {
        cout<<x[i]<<" "<<y[i]<<endl;
    }
    x.clear();
    y.clear();
}


int main() {
    #ifdef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif

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

    // cin>>t;
    while(t-- > 0) {
        solve();
    }
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)

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

// #define ONLINE_JUDGE 1
using namespace std;

int t = 1, n;
int a[1005];
vector<int> x,y;
void solve() {
    cin>>n;
    for(int i=0;i<n;i++) {
        cin>>a[i];
    }
    vector<int> nums(n);
    iota(nums.begin(), nums.end(), 1);
    for(int i = n - 1; i >= 0; i--) {
        int k = 0;
        while (k < n && nums[k] != a[i]) {
            k++;
        }
        
        for(int j = k - 1; j >= 0; j--) {
            x.push_back(nums[k]);
            y.push_back(nums[j]);
        }
        for(int j = 0; j < k; j++) {
            x.push_back(nums[j]);
            y.push_back(nums[k]);
        }
        for(int j = k + 1; j <= i; j++) {
            nums[j - 1] = nums[j];
            x.push_back(nums[j]);
            y.push_back(a[i]);
        }
        nums[i] = a[i];
    }
    cout<<x.size()<<endl;
    for(int i = 0; i < x.size(); i++) {
        cout<<x[i]<<" "<<y[i]<<endl;
    }
    x.clear();
    y.clear();
}


int main() {
    #ifdef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif

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

    // cin>>t;
    while(t-- > 0) {
        solve();
    }
    return 0;
}

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

// #define ONLINE_JUDGE 1
using namespace std;

int t = 1, n;
int a[1005];
vector<int> x,y;
void solve() {
    cin>>n;
    for(int i=0;i<n;i++) {
        cin>>a[i];
    }
    vector<int> nums(n);
    iota(nums.begin(), nums.end(), 1);
    for(int i = n - 1; i >= 0; i--) {
        int k = 0;
        while (k < n && nums[k] != a[i]) {
            k++;
        }
        
        for(int j = k - 1; j >= 0; j--) {
            x.push_back(nums[k]);
            y.push_back(nums[j]);
        }
        for(int j = 0; j < k; j++) {
            x.push_back(nums[j]);
            y.push_back(nums[k]);
        }
        for(int j = k + 1; j <= i; j++) {
            nums[j - 1] = nums[j];
            x.push_back(nums[j]);
            y.push_back(a[i]);
        }
        nums[i] = a[i];
    }
    cout<<x.size()<<endl;
    for(int i = 0; i < x.size(); i++) {
        cout<<x[i]<<" "<<y[i]<<endl;
    }
    x.clear();
    y.clear();
}


int main() {
    #ifdef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif

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

    // cin>>t;
    while(t-- > 0) {
        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>
using namespace std;

#define int long long
#define double long double
#define PII pair<int, int>

void solve(){ 
	int l, r;
	cin>>l>>r;

	int x = 0;
	int nr = r;
	while(nr){
		x ++;
		nr /= 2;
	}

	int a = (1ll << (x - 1));
	int b = a - 1;
	int c = 0;
	for(int i = l; i <= r; ++i){
		if(i != a && i != b){
			c = i;
			break;
		}
	}

	cout<<a<<" "<<b<<" "<<c<<"\n";

	return ;
}

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

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}

	return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

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

#define int long long
#define double long double
#define PII pair<int, int>

void solve(){ 
	int l, r;
	cin>>l>>r;

	int x = 0;
	int nr = r;
	while(nr){
		x ++;
		nr /= 2;
	}

	int a = l | (1ll << (x - 1));
	int b = a - 1;
	int c = 0;
	for(int i = l; i <= r; ++i){
		if(i != a && i != b){
			c = i;
			break;
		}
	}

	cout<<a<<" "<<b<<" "<<c<<"\n";

	return ;
}

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

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}

	return 0;
}

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

#define int long long
#define double long double
#define PII pair<int, int>

void solve(){ 
	int l, r;
	cin>>l>>r;

	int x = (l ^ r);
	int p = 0;
	for(int i = 0; i <= 31; ++i){
		if((x >> i) & 1){
			p = i;
		}
	}
	cout<<p<<"\n";
	int a = l | ((1ll << p) - 1);
	int b = a + 1;
	int c = 0;
	for(int i = l; i <= r; ++i){
		if(i != a && i != b){
			c = i;
			break;
		}
	}

	cout<<a<<" "<<b<<" "<<c<<"\n";

	return ;
}

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

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}

	return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

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

#define int long long
#define double long double
#define PII pair<int, int>

void solve(){ 
	int l, r;
	cin>>l>>r;

	int x = 0;
	int nr = r;
	while(nr){
		x ++;
		nr /= 2;
	}

	int a = (1ll << (x - 1));
	int b = a - 1;
	if(b < l){
		b = a + 1;
	}
	int c = 0;
	for(int i = l; i <= r; ++i){
		if(i != a && i != b){
			c = i;
			break;
		}
	}

	cout<<a<<" "<<b<<" "<<c<<"\n";

	return ;
}

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

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}

	return 0;
}

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

#define int long long
#define double long double
#define PII pair<int, int>

void solve(){ 
	int l, r;
	cin>>l>>r;

	int x = 0;
	int nr = r;
	while(nr){
		x ++;
		nr /= 2;
	}

	int a = l | (1ll << (x - 1));
	int b = a - 1;
	int c = 0;
	for(int i = l; i <= r; ++i){
		if(i != a && i != b){
			c = i;
			break;
		}
	}

	cout<<a<<" "<<b<<" "<<c<<"\n";

	return ;
}

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

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}

	return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

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

#define int long long
#define double long double
#define PII pair<int, int>

void solve(){ 
	int l, r;
	cin>>l>>r;

	int x = 0;
	int nr = r;
	while(nr){
		x ++;
		nr /= 2;
	}

	int a = (1ll << (x - 1));
	int b = a - 1;
	int c = 0;
	for(int i = l; i <= r; ++i){
		if(i != a && i != b){
			c = i;
			break;
		}
	}

	cout<<a<<" "<<b<<" "<<c<<"\n";

	return ;
}

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

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}

	return 0;
}

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

#define int long long
#define double long double
#define PII pair<int, int>

void solve(){ 
	int l, r;
	cin>>l>>r;

	int x = 0;
	int nr = r;
	while(nr){
		x ++;
		nr /= 2;
	}

	int a = (1ll << (x - 1));
	int b = a - 1;
	if(b < l){
		b = a + 1;
	}
	int c = 0;
	for(int i = l; i <= r; ++i){
		if(i != a && i != b){
			c = i;
			break;
		}
	}

	cout<<a<<" "<<b<<" "<<c<<"\n";

	return ;
}

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

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}

	return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

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

#define int long long
#define double long double
#define PII pair<int, int>

void solve(){ 
	int l, r;
	cin>>l>>r;

	int x = (l ^ r);
	int p = 0;
	for(int i = 0; i <= 31; ++i){
		if((x >> i) & 1){
			p = i;
		}
	}
	cout<<p<<"\n";
	int a = l | ((1ll << p) - 1);
	int b = a + 1;
	int c = 0;
	for(int i = l; i <= r; ++i){
		if(i != a && i != b){
			c = i;
			break;
		}
	}

	cout<<a<<" "<<b<<" "<<c<<"\n";

	return ;
}

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

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}

	return 0;
}

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

#define int long long
#define double long double
#define PII pair<int, int>

void solve(){ 
	int l, r;
	cin>>l>>r;

	int x = (l ^ r);
	int p = 0;
	for(int i = 0; i <= 31; ++i){
		if((x >> i) & 1){
			p = i;
		}
	}
	//cout<<p<<"\n";
	int a = l | ((1ll << p) - 1);
	int b = a + 1;
	int c = 0;
	for(int i = l; i <= r; ++i){
		if(i != a && i != b){
			c = i;
			break;
		}
	}

	cout<<a<<" "<<b<<" "<<c<<"\n";

	return ;
}

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

	int t = 1;
	cin>>t;
	while(t--){
		solve();
	}

	return 0;
}