Problem: 2057C - Trip to the Olympiad
Language: c++17 

Solution 1 (runtime: 93 ms):
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <chrono>
#define pb push_back
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define endl '\n'
#define ll long long
#define f first
#define fin cin
#define fout cout
#define s second
#define FAST cin.tie(0), cout.tie(0), ios::sync_with_stdio(0)
#define debug(x) cout << "DEBUG " << x << endl
#define debug2(x, y) cout << "DEBUG " << x << " " << y << endl
#define debug3(x, y, z) cout << "DEBUG " << x << " " << y << " " << z<< endl
#define debug4(x, y, z, o) cout << "DEBUG " << x << " " << y << " " << z<< " " << o << endl
#define all(x) x.begin(), x.end()
#define left esquerda
#define lb lower_bound
#define right direita
using namespace std;
void setIO(string s) {
ios_base::sync_with_stdio(0); cin.tie(0);
freopen((s+".in").c_str(),"r",stdin);
freopen((s+".out").c_str( ),"w",stdout);
}
typedef pair<ll, ll> pii;
typedef vector<vector<char>> mat;
typedef pair<int, string> pis;
const ll mod = 1e9 + 7, MAXN = 2e5 + 5;
typedef vector<int> vi;
typedef pair<int, pair<int, int>> piii;

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

    ll last = 1;
    while(last * 2 <= r) 
        last *= 2;

    int aux = last;
    while(true) {
        if( (last & r) && !(last & l)) {
            aux += last;
            break;
        }
        last /= 2;
    }

    cout << aux-1 << " " << aux << " " << aux + 2 << endl;

}

int32_t main() {
    int ct;
    cin >> ct;
    while(ct--)
        solve();
}

Solution 2 (runtime: 62 ms):
#include <map>
#include <queue>
#include <cmath>
#include <string>
#include <cstring>
#include <iomanip>
#include <iostream>
#define int long long
#define end "\n"
using namespace std;
const int N = 2e6+10;
int a1[N], b1[N], c1[N];

void slove()#include <map>
#include <queue>
#include <cmath>
#include <string>
#include <cstring>
#include <iomanip>
#include <iostream>
#define int long long
#define end "\n"
using namespace std;
const int N = 2e6+10;
int r1[N], l1[N];
int a1[N], b1[N], c1[N];

void slove()
{
	int l, r, cnt = 0, b = 0;
	cin >> l >> r;
	int n = l, m = r;
 	int a = 0;
	while(1)
	{
		if(r == 0)
			break;
		cnt ++;
		int t = r % 2;
		r1[cnt] = t;
		t = l % 2;
		l1[cnt] = t;
		r /= 2, l /= 2;
	}
	
	int f = 0;
	for(int i = cnt; i>= 1; i --)
	{

		if(r1[i] != l1[i])
		{
			f = i;
			break;
		}
		a1[i] = r1[i];
		b1[i] = r1[i];
	}
	int x = 1;
	a1[f] = 1;
	b1[f] = 0;
	for(int i = f - 1; i >= 1; i --)
	{
		a1[i] = 0;
		b1[i] = 1;
	}
	
	for(int i = 1; i <= cnt; i ++)
	{
		a += a1[i] * x;
		b += b1[i] * x;
		x *= 2;
		
	}

	if (b == n) cout << a << " " << b << " " << m << "\n";
    else cout << n << " " << a << " " << b << "\n";


		
}
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cout << fixed << setprecision(10);
	
	int T = 1; 
	cin >> T;
	while(T--)
	{
		slove();
	}
}

{
	int l, r, cnt = 0, b = 0;
	cin >> l >> r;
	int a = r, c = l;
	while(1)
	{
		if(r == 0)
			break;
		cnt ++;
		int t = r % 2;
		a1[cnt] = t;
		t = l % 2;
		c1[cnt] = t;
		r /= 2, l /= 2;
	}
	
	int f = 0;
	for(int i = cnt; i>= 1; i --)
	{

		if(a1[i] != c1[i])
		{
			if(f == 0)
			{

				b1[i] = c1[i];
				f ++;
				
			}
			else
			{
				b1[i] = a1[i];
			}
		}
		if(a1[i] == c1[i])
		{
			if(f != 0)
				b1[i] = a1[i] ^ 1;
			else
				b1[i] = a1[i];
		}
	}
	int x = 1;
	for(int i = 1; i <= cnt; i ++)
	{
		
		b += x * b1[i];
		x *= 2;
	}
//	cout << (a^b) + (b^c) + (a^c) << endl;
	cout << a << " " << b << " " << c << endl;
		
}
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cout << fixed << setprecision(10);
	
	int T = 1; 
	cin >> T;
	while(T--)
	{
		slove();
	}
}