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

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, std::less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#define ln '\n'
#define ull unsigned  long long
#define ll long long 
#define vll vector<ll>
#define pll pair<ll, ll>
#define ff first
#define vpll vector<pair<ll,ll>>
#define pii pair<int,int> 
#define ld long double
#define ss second
using namespace std;


void setIO(const string io="a"){
    freopen((io+".in").c_str(),"r",stdin) ;
    freopen((io+".out").c_str(),"w",stdout) ;
}
void f(ll a,ll b,ll c){
	cout << (a^b) + (a^c) + (b^c) << ln ;
}

void solve(){
	ll l , r ; cin >> l >> r ;
	ll n = log2(r)+1 ; //cout << n << ln ;
	string s1 = "" ; for(ll i=0;i<n;i++) s1 += '0' ;
	ll a = r , i = n-1 ;
	while(a){
		if ((a&1ll)) s1[i] = '1' ;
		a>>= 1ll ; i-- ;
	}
	string s2 = "" ; for(ll i=0;i<n;i++) s2 += '0' ;
	ll b = r-1 ; i = n-1 ;
	while(b) {
		if ((b&1ll)) s2[i] = '1' ;
		b >>= 1ll ; i-- ;
	}
	string s3 = "" ; for(ll i=0;i<n;i++) s3 += '0' ;
	ll pow = n-1 , val = 0 ; 
	for(ll i=0;i<n;i++){
		if (val+(1<<pow)-1 < l  or  (val+(1<<pow)<r-1 and   (s1[i]=='0' or s2[i]=='0')) ) s3[i] = '1' , val += (1ll<<pow) ;
		pow-- ; 
	}
	//cout << s1  << " " << s2 <<  " " << s3 << ln ;
	cout << r << " " << r-1 << " " << val << ln ;
	//f(r,r-1,val) ;
	return ;
}
int main() {
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//setIO() ;
	ll t = 1 ; 
	cin >> t ;
	for(ll i=1;i<=t;i++){
		//cout << "Case " << i << ": " ;
		solve() ;
	}
    return 0;
}





Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, std::less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#define ln '\n'
#define ull unsigned  long long
#define ll long long 
#define vll vector<ll>
#define pll pair<ll, ll>
#define ff first
#define vpll vector<pair<ll,ll>>
#define pii pair<int,int> 
#define ld long double
#define ss second
using namespace std;


void setIO(const string io="a"){
    freopen((io+".in").c_str(),"r",stdin) ;
    freopen((io+".out").c_str(),"w",stdout) ;
}
void f(ll a,ll b,ll c){
	cout << (a^b) + (a^c) + (b^c) << ln ;
}

void solve(){
	ll l , r ; cin >> l >> r ;
	ll n = log2(r)+1 ; 
	string s1 = "" ; for(ll i=0;i<n;i++) s1 += '0' ;
	ll a = r , i = n-1 ;
	while(a){
		if ((a&1ll)) s1[i] = '1' ;
		a>>= 1ll ; i-- ;
	}
	string s2 = "" ; for(ll i=0;i<n;i++) s2 += '0' ;
	ll b = l ;  i = n-1 ;
	while(b){
		if ((b&1ll)) s2[i] = '1' ;
		b>>= 1ll ; i-- ;
	}
	string s3 = "" ; for(ll i=0;i<n;i++) s3 += '0' ;
	ll pow = n-1 , val3 = 0 ; 
	for(ll i=0;i<n;i++){
		if (val3+(1ll<<pow)> r ) {
			pow-- ; continue ;
		}
		else if (val3 + (1ll<<pow)-1<l) s3[i] = '1'  ,val3 += (1ll<<pow); 
		else if (s1[i]=='0' and s2[i]=='0') s3[i] = '1' , val3 += (1ll<<pow); 
		pow-- ; 
	}
	if (l==val3) val3++ ;
	//cout << s1  << " " << s2 <<  " " << s3 << ln ;
	cout << r << " " <<  l<< " " << val3 << ln ;
	//f(r,l,val3) ;
	return ;
}
int main() {
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
//	setIO() ;
	ll t = 1 ; 
	cin >> t ;
	for(ll i=1;i<=t;i++){
		//cout << "Case " << i << ": " ;
		solve() ;
	}
    return 0;
}