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):
#include <bits/stdc++.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <math.h>
#include <set>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll  long long
const ll MOD = 998244353 ;
inline ll mul(ll a1, ll a2) { return ((a1 * a2) % MOD); }
inline ll sum(ll a1, ll a2) { return ((a1 + a2) % MOD); }
// inline ll sub(ll a1, ll a2) { return  ((a1 - a2 + MOD) % MOD); }
int main() {
    IOS
    int test ;
    cin>>test;
    while(test--) {
        ll l , r ;
        cin>>l>>r;
        ll z = 1 ;
        while (z<=r) {
            z *= 2 ;
        }
        z /= 2 ;
        ll a1 , a2 , a3 ;
        if (z > l) {
            a1 = z ;
            a2 = z-1 ;
        }else {
            a1 = l ;
            a2 = l + 1 ;
        }
        ll max = 0 ;
        for (ll i = l ; i <= r ; i++) {
            if((i == a2)or(i==a1)) {
                continue ;
            }
            if ( ((a1^a2)+(a2^i)+(a1^i)) >= max) {
                max = (a1^a2)+(a2^i)+(a1^i) ;
                a3 = i ;
            }
        }
        cout<<a1<<" "<<a2<<" "<<a3<<endl;
    }
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <math.h>
#include <set>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll  long long
// const ll MOD = 998244353 ;
// inline ll mul(ll a1, ll a2) { return ((a1 * a2) % MOD); }
// inline ll sum(ll a1, ll a2) { return ((a1 + a2) % MOD); }
// inline ll sub(ll a1, ll a2) { return  ((a1 - a2 + MOD) % MOD); }
int main() {
    IOS
    int test ;
    cin>>test;
    while(test--) {
        ll l , r ;
        cin>>l>>r;
        ll z = 1 ,  x = l ^ r ;
        while( x % z == 0 ) {
            z *= 2 ;
        }
        z /= 2 ;
        x = z ;
        z *= (r/z) ;
        if(z<=l) {
            z +=x ;
        }
        ll a1 = z , a2 = z - 1 , a3;
        ll max = -1  ;
        for( int i = l ; i <= r ; i++ ) {
            if ((i==a1)or(i==a2)) {
                continue ;
            }
            if ((i^a1)+(i^a2)>max) {
                max = i^a1 + i^a2 ;
                a3 = i ;
            }
        }
        cout<<a1<<" "<<a2<<" "<<a3<<endl;
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Time limit exceeded on test 3):
#include <bits/stdc++.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <math.h>
#include <set>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll  long long
// const ll MOD = 998244353 ;
// inline ll mul(ll a1, ll a2) { return ((a1 * a2) % MOD); }
// inline ll sum(ll a1, ll a2) { return ((a1 + a2) % MOD); }
// inline ll sub(ll a1, ll a2) { return  ((a1 - a2 + MOD) % MOD); }
int main() {
    IOS
    int test ;
    cin>>test;
    while(test--) {
        ll l , r ;
        cin>>l>>r;
        ll z = 1 ,  x = l ^ r ;
        int k = 31 - __builtin_clz(l ^ r);
        z = 1 << k ;
        ll a1 = l | (z-1) , a2 = a1 + 1 , a3;
        ll max = -1  ;
        for( int i = l ; i <= r ; i++ ) {
            if ((i==a1)or(i==a2)) {
                continue ;
            }
            if ((i^a1)+(i^a2)>max) {
                max = i^a1 + i^a2 ;
                a3 = i ;
            }
        }
        cout<<a1<<" "<<a2<<" "<<a3<<endl;
    }
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <math.h>
#include <set>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll  long long
// const ll MOD = 998244353 ;
// inline ll mul(ll a1, ll a2) { return ((a1 * a2) % MOD); }
// inline ll sum(ll a1, ll a2) { return ((a1 + a2) % MOD); }
// inline ll sub(ll a1, ll a2) { return  ((a1 - a2 + MOD) % MOD); }
int main() {
    IOS
    int test ;
    cin>>test;
    while(test--) {
        ll l , r ;
        cin>>l>>r;
        ll z = 1 ,  x = l ^ r ;
        int k = 31 - __builtin_clz(l ^ r);
        z = 1 << k ;
        ll a1 = l | (z-1) , a2 = a1 + 1 , a3 ;
        if(a1 == l) {
            a3 = r ;
        }else {
            a3 = l ;
        }
        cout<<a1<<" "<<a2<<" "<<a3<<endl;
    }
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <math.h>
#include <set>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll  long long
// const ll MOD = 998244353 ;
// inline ll mul(ll a1, ll a2) { return ((a1 * a2) % MOD); }
// inline ll sum(ll a1, ll a2) { return ((a1 + a2) % MOD); }
// inline ll sub(ll a1, ll a2) { return  ((a1 - a2 + MOD) % MOD); }
const int MOD = 1e9 + 7;
int main() {
    IOS
    int test ;
    cin>>test;
    while(test--) {
        int n , ans = 0 ;
        cin>>n;
        vector<int> v(n);
        for(int i=0;i<n;i++) {
            cin>>v[i];
            ans += v[i];
        }
        for(int i=0;i<n-1;i++) {
            int aux = 0 ;
            reverse(v.begin() , v.begin()+n-i);
            for(int j=0;j<n-i-1;j++) {
                v[j] = v[j+1] - v[j];
                aux += v[j];
            }
            ans = max(ans , aux);
        }
        cout<<ans<<endl;
    }
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <math.h>
#include <set>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll  long long
// const ll MOD = 998244353 ;
// inline ll mul(ll a1, ll a2) { return ((a1 * a2) % MOD); }
// inline ll sum(ll a1, ll a2) { return ((a1 + a2) % MOD); }
// inline ll sub(ll a1, ll a2) { return  ((a1 - a2 + MOD) % MOD); }
const int MOD = 1e9 + 7;
int main() {
    IOS
    int test ;
    cin>>test;
    while(test--) {
        int n , ans = 0 ;
        cin>>n;
        vector<int> v(n);
        for(int i=0;i<n;i++) {
            cin>>v[i];
            ans += v[i];
        }
        for(int i=0;i<n-1;i++) {
            int aux = 0 ;
            reverse(v.begin() , v.begin()+n-i);
            for(int j=0;j<n-i-1;j++) {
                v[j] = v[j+1] - v[j];
                aux += v[j];
            }
            ans = max(ans , aux);
        }
        cout<<ans<<endl;
    }
    return 0;
}


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <math.h>
#include <set>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll  long long
// const ll MOD = 998244353 ;
// inline ll mul(ll a1, ll a2) { return ((a1 * a2) % MOD); }
// inline ll sum(ll a1, ll a2) { return ((a1 + a2) % MOD); }
// inline ll sub(ll a1, ll a2) { return  ((a1 - a2 + MOD) % MOD); }
const int MOD = 1e9 + 7;
int main() {
    IOS
    int test ;
    cin>>test;
    while(test--) {
        ll n , ans = 0 ;
        cin>>n;
        vector<ll> v(n);
        for(int i=0;i<n;i++) {
            cin>>v[i];
            ans += v[i];
        }
        for(int i=0;i<n-1;i++) {
            ll aux = 0 ;
            reverse(v.begin() , v.begin()+n-i);
            for(int j=0;j<n-i-1;j++) {
                v[j] = v[j+1] - v[j];
                aux += v[j];
            }
            ans = max(ans , aux);
        }
        cout<<ans<<endl;
    }
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <math.h>
#include <set>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll  long long
// const ll MOD = 998244353 ;
// inline ll mul(ll a1, ll a2) { return ((a1 * a2) % MOD); }
// inline ll sum(ll a1, ll a2) { return ((a1 + a2) % MOD); }
// inline ll sub(ll a1, ll a2) { return  ((a1 - a2 + MOD) % MOD); }
const int MOD = 1e9 + 7;
int main() {
    IOS
    int test ;
    cin>>test;
    while(test--) {
        ll n , ans = 0 ;
        cin>>n;
        vector<ll> v(n);
        for(int i=0;i<n;i++) {
            cin>>v[i];
            ans += v[i];
        }
        for(int i=0;i<n-1;i++) {
            ll aux = 0 ;
            reverse(v.begin() , v.begin()+n-i);
            for(int j=0;j<n-i-1;j++) {
                v[j] = v[j+1] - v[j];
                aux += v[j];
            }
            ans = max(ans , aux);
        }
        cout<<ans<<endl;
    }
    return 0;
}


Submission (verdict: Accepted):
#include <bits/stdc++.h>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <math.h>
#include <set>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll  long long
// const ll MOD = 998244353 ;
// inline ll mul(ll a1, ll a2) { return ((a1 * a2) % MOD); }
// inline ll sum(ll a1, ll a2) { return ((a1 + a2) % MOD); }
// inline ll sub(ll a1, ll a2) { return  ((a1 - a2 + MOD) % MOD); }
const int MOD = 1e9 + 7;
int main() {
    IOS
    int test ;
    cin>>test;
    while(test--) {
        ll n , ans = 0 ;
        cin>>n;
        int c = 1 ;
        vector<ll> v(n);
        for(int i=0;i<n;i++) {
            cin>>v[i];
            ans += v[i];
        }
        for(int i=0;i<n-1;i++) {
            ll aux = 0 ;
            for(int j=0;j<n-c;j++) {
                v[j]=v[j+1]-v[j];
                aux += v[j];
            }
            c ++ ;
            ans = max(max(ans, aux),-aux);
        }
        cout<<ans<<endl;
    }
    return 0;
}
Problem: 2050E - Three Strings
Language: C++17 (GCC 7-32)

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

#define MOD 1000000007
#define loop(i,a,b) for(int i = a;i < b;i++)
#define append push_back
#define vi vector<int>
#define mi map<int, int>
#define sort(a) sort(a.begin(), a.end())
#define int long long

typedef unsigned long long ull;

using namespace std;

void fast_io() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
}

// <-----------SidZRed-------------->
// <----Why are you reading this---->


signed main(){
    fast_io();

    int t;
    cin>>t;
    
    while(t--){
        string a, b, c;
        cin>>a>>b>>c;

        vector<vector<int>> dp(c.length()+1, vector<int>(a.length() + 1, INT_MAX));
        // dp[x][i] represents the minimum number of changes needed to create the first x characters of c using the first i characters of a and first x-i characters of b.

        dp[0][0] = 0;

        for(int x=1;x<=c.length();x++){
            dp[x][0] = dp[x-1][0] + (c[x-1] != b[x-1]);
        }
        for(int i=1;i<=a.length();i++){
            dp[i][i] = dp[i-1][i-1] + (c[i-1] != a[i-1]);
        }
        
        for(int x=1;x<=c.length();x++){
            for(int i=1;i<=min(x, (int)a.length());i++){
                dp[x][i] = min(dp[x-1][i] + (c[x-1] != b[x-i-1]), dp[x-1][i-1] + (c[x-1] != a[i-1]));
            }
        }

        int ans = *min_element(dp[c.length()].begin(), dp[c.length()].end());
        cout<<ans<<endl;
    }
    return 0;
}

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

#define MOD 1000000007
#define loop(i,a,b) for(int i = a;i < b;i++)
#define append push_back
#define vi vector<int>
#define mi map<int, int>
#define sort(a) sort(a.begin(), a.end())
#define int long long

typedef unsigned long long ull;

using namespace std;

void fast_io() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
}

// <-----------SidZRed-------------->
// <----Why are you reading this---->


signed main(){
    fast_io();

    int t;
    cin>>t;
    
    while(t--){
        string a, b, c;
        cin>>a>>b>>c;

        vector<vector<int>> dp(c.length()+3, vector<int>(a.length() + 3, INT_MAX));
        // dp[x][i] represents the minimum number of changes needed to create the first x characters of c using the first i characters of a and first x-i characters of b.

        dp[0][0] = 0;

        for(int x=1;x<=c.length();x++){
            dp[x][0] = dp[x-1][0] + (c[x-1] != b[x-1]);
        }
        for(int i=1;i<=a.length();i++){
            dp[i][i] = dp[i-1][i-1] + (c[i-1] != a[i-1]);
        }
        
        for(int x=1;x<=c.length()+1;x++){
            for(int i=1;i<=min(x, (int)a.length()+1);i++){
                dp[x][i] = min(dp[x-1][i] + (c[x-1] != b[x-i-1]), dp[x-1][i-1] + (c[x-1] != a[i-1]));
            }
        }

        int ans = *min_element(dp[c.length()].begin(), dp[c.length()].end());
        cout<<ans<<endl;
    }
    return 0;
}
Problem: 2050E - Three Strings
Language: C++17 (GCC 7-32)


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

#define MOD 1000000007
#define loop(i,a,b) for(int i = a;i < b;i++)
#define append push_back
#define vi vector<int>
#define mi map<int, int>
#define sort(a) sort(a.begin(), a.end())
#define int long long

typedef unsigned long long ull;

using namespace std;

void fast_io() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
}

// <-----------SidZRed-------------->
// <----Why are you reading this---->


signed main(){
    fast_io();

    int t;
    cin>>t;
    
    while(t--){
        string a, b, c;
        cin>>a>>b>>c;

        vector<vector<int>> dp(c.length()+1, vector<int>(a.length() + 1, INT_MAX));
        // dp[x][i] represents the minimum number of changes needed to create the first x characters of c using the first i characters of a and first x-i characters of b.

        dp[0][0] = 0;

        for(int x=1;x<=c.length();x++){
            dp[x][0] = dp[x-1][0] + (c[x-1] != b[x-1]);
        }
        for(int i=1;i<=a.length();i++){
            dp[i][i] = dp[i-1][i-1] + (c[i-1] != a[i-1]);
        }
        
        for(int x=1;x<=c.length();x++){
            for(int i=1;i<=min(x, (int)a.length());i++){
                dp[x][i] = min(dp[x-1][i] + (c[x-1] != b[x-i-1]), dp[x-1][i-1] + (c[x-1] != a[i-1]));
            }
        }

        int ans = *min_element(dp[c.length()].begin(), dp[c.length()].end());
        cout<<ans<<endl;
    }
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++23 (GCC 14-64, msys2)


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

using namespace std;
using ll = long long int;
using pii = pair<int,int>;

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<int> c(n), perm(n);
    iota(perm.begin(), perm.end(), 1);
    for(int i=0; i<n; i++){
        cin >> c[i];
    } 
    vector<pii> ans;
    set<pii> st;
    for(int i=0; i<n; i++){
        int pos = find(perm.begin(), perm.end(), c[i]) - perm.begin();
        if(pos == i) continue;
        if(pos<i){
            for(int j=pos; j<i; j++){
                ans.push_back({perm[j+1], perm[j]});
                st.insert({perm[j+1], perm[j]});
                swap(perm[j], perm[j+1]);
            }
        }
        else{
            for(int j=i; j<pos; j++){
                ans.push_back({perm[j+1], perm[j]});
                st.insert({perm[j+1], perm[j]});
                swap(perm[j], perm[j+1]);
            }
        }
    }
    for(int i=1; i<n; i++){
        int ind = i;
        for(int j=i-1; j>=0; j--){
            if(st.count({perm[j], perm[i]})==0){
                ind = j;
            }
            else break;
        }
        if(ind != i){
            for(int j=i-1; j>=ind; j--){
                ans.push_back({perm[i], perm[j]});
            }
            for(int j=ind; j<i; j++){
                ans.push_back({perm[j], perm[i]});
            }
        }
    }
    cout << ans.size() << endl;
    for(auto &[i,j]: ans){
        cout << i << " " << j << endl;
    }
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++23 (GCC 14-64, msys2)

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

using namespace std;
using ll = long long int;
using pii = pair<int,int>;

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<int> c(n), perm(n);
    iota(perm.begin(), perm.end(), 1);
    for(int i=0; i<n; i++){
        cin >> c[i];
    } 
    vector<pii> ans;
    set<pii> st;
    for(int i=0; i<n; i++){
        int pos = find(perm.begin(), perm.end(), c[i]) - perm.begin();
        if(pos == i) continue;
        if(pos<i){
            for(int j=pos; j<i; j++){
                ans.push_back({perm[j+1], perm[j]});
                st.insert({perm[j+1], perm[j]});
                swap(perm[j+1], perm[j]);
            }
        }
        else{
            for(int j=pos; j>i; j--){
                ans.push_back({perm[j], perm[j-1]});
                st.insert({perm[j], perm[j-1]});
                swap(perm[j], perm[j-1]);
            }
        }
    }
    for(int i=1; i<n; i++){
        int ind = i;
        for(int j=i-1; j>=0; j--){
            if(st.count({perm[j], perm[i]})==0){
                ind = j;
            }
            else break;
        }
        if(ind != i){
            for(int j=i-1; j>=ind; j--){
                ans.push_back({perm[i], perm[j]});
            }
            for(int j=ind; j<i; j++){
                ans.push_back({perm[j], perm[i]});
            }
        }
    }
    cout << ans.size() << endl;
    for(auto &[i,j]: ans){
        cout << i << " " << j << endl;
    }
    return 0;
}

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

using namespace std;
using ll = long long int;
using pii = pair<int,int>;

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<int> c(n), perm(n);
    iota(perm.begin(), perm.end(), 1);
    for(int i=0; i<n; i++){
        cin >> c[i];
    } 
    vector<pii> ans;
    for(int i=0; i<n; i++){
        int pos = find(perm.begin(), perm.end(), c[i]) - perm.begin();
        for(int j=pos+1; j<n; j++){
            ans.push_back({perm[j], perm[pos]});
        }
        for(int j=n-1; j>=pos+1; j--){
            ans.push_back({perm[pos], perm[j]});
        }
        for(int j=pos; j>i; j--){
            ans.push_back({perm[j], perm[j-1]});
            swap(perm[j], perm[j-1]);
        }
    }
    cout << ans.size() << endl;
    for(auto &[i,j]: ans){
        cout << i << " " << j << endl;
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
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;

void solve() {
    int l,r; cin >> l >> r;
    int k = 31 - __builtin_clz(l^r);
    int a = 1 | ((1 << k)-1);
    int b = a+1;
    int c = (a == l ? r : l);

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

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
   
    int t; cin >> t;
    while (t--) {
        solve();
    }
    
}

Submission (verdict: Accepted):
#include "bits/stdc++.h"
using namespace std;
using ll = long long;

void solve() {
    int l, r; cin >> l >> r;
    
    int a = 0, b = 0, c = 0;
    for (int i = 29; i >= 0; i--) {
        if ((l ^ r) >> i & 1) {
            b |= 1 << i;
            a |= (1 << i) - 1;
            break;
        } else {
            a |= l & (1 << i);
            b |= l & (1 << i);
        }
    }
    
    c = l;
    while (c == a || c == b) {
        c++;
    }
    
    std::cout << a << " " << b << " " << c << "\n";
}
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int t;
    cin >> t;
    
    while (t--) {
        solve();
    }
    
    return 0;
}
Problem: 2057C - Trip to the Olympiad
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;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
   
    int t; cin >> t;
    while (t--) {
        int l,r; cin >> l >> r;
        int k = 31 - __builtin_clz(l^r);
        int a = 1 | ((1 << k)-1);
        int b = a+1;
        int c = (a == l ? r : l);

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

Submission (verdict: Wrong answer on test 1):
#include "bits/stdc++.h"
using namespace std;
using ll = long long;

void solve() {
    int l,r; cin >> l >> r;
    int k = 31 - __builtin_clz(l^r);
    int a = 1 | ((1 << k)-1);
    int b = a+1;
    int c = (a == l ? r : l);

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

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
   
    int t; cin >> t;
    while (t--) {
        solve();
    }
    
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include "bits/stdc++.h"
using namespace std;
using ll = long long;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
   
    int t; cin >> t;
    while (t--) {
        int l,r; cin >> l >> r;
        int k = 31 - __builtin_clz(l^r);
        int a = 1 | ((1 << k)-1);
        int b = a+1;
        int c = (a == l ? r : l);

        cout << a << " " << b << " " << c << "\n";
    }
    
    return 0;
}
Problem: 2057C - Trip to the Olympiad
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;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
   
    int t; cin >> t;
    while (t--) {
        int l,r; cin >> l >> r;
        int k = 31 - __builtin_clz(l^r);
        int a = 1 | ((1 << k)-1);
        int b = a+1;
        int c = (a == l ? r : l);

        cout << a << " " << b << " " << c << "\n";
    }
    
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include "bits/stdc++.h"
using namespace std;
using ll = long long;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
   
    int t; cin >> t;
    while (t--) {
        int l,r; cin >> l >> r;
        int k = 31 - __builtin_clz(l^r);
        int a = 1 | ((1 << k)-1);
        int b = a+1;
        int c = (a == l ? r : l);

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