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

Previous submission (verdict: Wrong answer on test 1):
#define ll long long
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
std::string toBinaryString(long long num) {
std::bitset<64> binary(num);
return binary.to_string();
}
long long binaryToLongLong(const std::string& binary) {
std::bitset<64> binarySet(binary);
return static_cast<long long>(binarySet.to_ullong());
}
bool compareByFirst(const std::pair<ll, ll>& a, const std::pair<ll, ll>& b) {
return a.first < b.first; // Ascending order by the first element
}
int main(){
    long long t;
    cin>>t;
    while(t--){
        ll l;
        ll r;
        cin>>l;
        cin>>r;
        ll ans1;
        ll ans2;
        for(ll i=r;i>=l;i++)
        {
            string s=toBinaryString(i);
            string g="";
            ll index=0;
            for(ll j=0;j<s.size();j++)
            {
                if(s[j]=='0')
                g+='0';
                else 
                {
                    index=j;
                    break;
                }


            }
            for(ll j=index;j<s.size();j++)
            {
                if(s[j]=='1')
                g+='0';
                else 
                g+='1';
            }
            ll number=binaryToLongLong(g);
            if(number>=l&&number<=r)
            {
                ans1=i;
                ans2=number;
                break;

            }
        }
        ll ans3;
        for(ll i=l;i<=r;i++)
        {
            if(i!=ans1&&i!=ans2)
            {
                ans3=i;
                break;
            }
        }
        cout<<ans1<<' '<<ans2<<' '<<ans3<<endl;
    }
}


Submission (verdict: Wrong answer on test 1):
#define ll long long
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
std::string toBinaryString(long long num) {
std::bitset<64> binary(num);
return binary.to_string();
}
long long binaryToLongLong(const std::string& binary) {
std::bitset<64> binarySet(binary);
return static_cast<long long>(binarySet.to_ullong());
}
bool compareByFirst(const std::pair<ll, ll>& a, const std::pair<ll, ll>& b) {
return a.first < b.first; // Ascending order by the first element
}
int main(){
    long long t;
    cin>>t;
    while(t--){
        ll l;
        ll r;
        cin>>l;
        cin>>r;
        ll ans1;
        ll ans2;
        for(ll i=r;i>=l;i--)
        {
            string s=toBinaryString(i);
            string g="";
            ll index=0;
            for(ll j=0;j<s.size();j++)
            {
                if(s[j]=='0')
                g+='0';
                else 
                {
                    index=j;
                    break;
                }


            }
            for(ll j=index;j<s.size();j++)
            {
                if(s[j]=='1')
                g+='0';
                else 
                g+='1';
            }
            ll number=binaryToLongLong(g);
            if(number>=l&&number<=r)
            {
                ans1=i;
                ans2=number;
                break;

            }
        }
        ll ans3;
        for(ll i=l;i<=r;i++)
        {
            if(i!=ans1&&i!=ans2)
            {
                ans3=i;
                break;
            }
        }
        cout<<ans1<<' '<<ans2<<' '<<ans3<<endl;
    }
}