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

Previous submission (verdict: Wrong answer on test 1):
    #include <bits/stdc++.h>
    using namespace std;
    using i64 = long long;
    using u64 = unsigned long long;
    using u32 = unsigned;
    using u128 = unsigned __int128;
    int binaryToDecimal(string n)
    {
        string num = n;
        int dec_value = 0;
 
    // Initializing base value to 1, i.e 2^0
        i64 base = 1;
 
        int len = num.length();
        for (int i = len - 1; i >= 0; i--) {
            if (num[i] == '1')
                dec_value += base;
                base = base * 2;
        }
 
        return dec_value;
    }
    string decToBinary(int n){
        string s="";
    // Size of an integer is assumed to be 32 bits
        for (int i = 31; i >= 0; i--) {
            int k = n >> i;
            if (k & 1)
                s.push_back('1');
            else
                s.push_back('0');
            }
        return s;
    }
    void solve() {
        int l, r;
        cin >> l >> r;
        string s1=decToBinary(l);
        string s2=decToBinary(r);
        //cout<<s1<<"\n"<<s2<<"\n";
        int ind=0;
        for(int i=0;i<32;i++){
            if(s1[i]!=s2[i]){
                ind=i;
                break;
            }
        }
        s1[ind]='1';
        s2[ind]='0';
        for(int i=0;i<32;i++){
            if(i<=ind){
                continue;
            }
            //cout<<i<<"\n";
            s1[i]='0';
            s2[i]='1';
            //cout<<s1<<"\n"<<s2<<"\n";
        }
        i64 x=binaryToDecimal(s1);
        i64 y=binaryToDecimal(s2);
        if(x==y+1){
            cout<<x<<" "<<y<<" "<<y-1<<"\n";
            return;
        }
        cout<<x<<" "<<y<<" "<<y+1<<"\n";
    }
     
    int main() {
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
        
        int t;
        cin >> t;
        
        while (t--) {
            solve();
        }
        
        return 0;
    }

Submission (verdict: Accepted):
    #include <bits/stdc++.h>
    using namespace std;
    using i64 = long long;
    using u64 = unsigned long long;
    using u32 = unsigned;
    using u128 = unsigned __int128;
    int binaryToDecimal(string n)
    {
        string num = n;
        int dec_value = 0;
 
    // Initializing base value to 1, i.e 2^0
        i64 base = 1;
 
        int len = num.length();
        for (int i = len - 1; i >= 0; i--) {
            if (num[i] == '1')
                dec_value += base;
                base = base * 2;
        }
 
        return dec_value;
    }
    string decToBinary(int n){
        string s="";
    // Size of an integer is assumed to be 32 bits
        for (int i = 31; i >= 0; i--) {
            int k = n >> i;
            if (k & 1)
                s.push_back('1');
            else
                s.push_back('0');
            }
        return s;
    }
    void solve() {
        int l, r;
        cin >> l >> r;
        string s1=decToBinary(l);
        string s2=decToBinary(r);
        //cout<<s1<<"\n"<<s2<<"\n";
        int ind=0;
        for(int i=0;i<32;i++){
            if(s1[i]!=s2[i]){
                ind=i;
                break;
            }
        }
        s1[ind]='1';
        s2[ind]='0';
        for(int i=0;i<32;i++){
            if(i<=ind){
                continue;
            }
            //cout<<i<<"\n";
            s1[i]='0';
            s2[i]='1';
            //cout<<s1<<"\n"<<s2<<"\n";
        }
        i64 z;
        i64 x=binaryToDecimal(s1);
        i64 y=binaryToDecimal(s2);
        for(i64 i=l;i<=r;i++){
            if(i!=x&& i!=y){
                z=i;
                break;
            }
        }
        cout<<x<<" "<<y<<" "<<z<<"\n";
    }
     
    int main() {
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
        
        int t;
        cin >> t;
        
        while (t--) {
            solve();
        }
        
        return 0;
    }