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

Previous submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <stack>
#include <cstring>
#include <math.h>
#include <queue>
#include <deque>
#include <iomanip>
#include <bitset>
#include <random>
#define INF 4e10
#define INF64 9223372036854775807
#define INF32 2147483647
#define MAXN 2e5 + 10
#define MOD INF32
#define REDIRECT 1
#define fout freopen("out.out", "w", stdout)
#define fin freopen("test.in", "r", stdin)
#define Debug(x) for(int i = 0;i<x.size();++i)cout<<x[i]<<" ";cout<<endl
#define PUT(x) for(int i = 0;i<x.size();++i)cout<<x[i]<<" ";cout<<endl
#define ARRCIN(x) for(auto& i:x) cin>>i
#define LEN(x) to_string(x).size()
#define ALL(x) x.begin(),x.end()
#define _tostring(x) to_string(x);//自动保留负号
#define _toint(x) stoi(x);//stoi会自动将string数值部分的首位0消去，同时还会保留负号
#define _toll(x) stoll(x);
#define YES "YES\n"
#define NO "NO\n"
#define endl '\n'
#define int long long
using namespace std;
using i64 = unsigned long long;
using u64 = unsigned long long;
const int maxn = 2e5+10;
typedef long long LL;	
typedef long long llint;
typedef unsigned long long u64;
typedef pair<int, int> pii;
bool cmp(int a, int b) {return a > b;}
int qkpow(int a,int n,int mod = INF32) {int ans = 1;while(n){if(n&1) ans = (ans * a) % mod;a = (a * a) % mod;n >>= 1;}return (ans + mod) % mod;}
int gcd(int a,int b) {int tem = 0; while(b) tem = b,b = a % b,a = tem; return tem;}
int lcm(int a,int b) {return a * b / gcd(a, b);}
int lowbit(int x){return x & -x;}
std::mt19937_64 rng(time(0));
//裴蜀定理：
//	若a,b是整数,且gcd(a,b)=d，那么对于任意的整数x,y,ax+by都一定是d的倍数，特别地，一定存在整数x,y，使ax+by=d成立。
//	它的一个重要推论是：a,b互质的充要条件是存在整数x,y使ax+by=1.
//	另外，多元线性方程 a1x1 + a2x2 + ... + anxn = w  有解的充要条件是gcd(a1,a2,a3,...,an) | w
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//此处采用运算符重载的方式，还可以重载仿函数
struct node{
	int l, r, cnt, size, x, y, val;
	bool operator<(const node& a)const {return val<a.val;}//大根堆
};//思路：统计数量（0-9）；如果为0则忽略，不为零

const int N = 32;
bool solve() {
	int l, r;cin>>l>>r;
	bitset<N> bl(l), br(r);
	// cout<<bl<<endl<<br<<endl;
	
	int pos = 0;
	for(int i = N - 1;i >= 0;--i){
		if(bl[i] != br[i]) {
			pos = i;
			break;
		}
	}
	
	int a = 0, b = 0, c = 0;
	a = l | ((1 << pos) - 1);
	b = a + 1;
	
	for(int i = l+1;i <= r;++i){
		if(i != a && i != b){
			c = i;
			break;
		}
	}
	
	cout<<a<<" "<<b<<" "<<c<<endl;
	// cout<<(a ^ b) + (b ^ c) + (a ^ c)<<endl;
	return 1;
}

signed main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	if (!REDIRECT) fout, fin;
	int _ = 1;
	std::cin >> _;
	while (_--)
		solve();
	return 0;
}
































Submission (verdict: Accepted):
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <stack>
#include <cstring>
#include <math.h>
#include <queue>
#include <deque>
#include <iomanip>
#include <bitset>
#include <random>
#define INF 4e10
#define INF64 9223372036854775807
#define INF32 2147483647
#define MAXN 2e5 + 10
#define MOD INF32
#define REDIRECT 1
#define fout freopen("out.out", "w", stdout)
#define fin freopen("test.in", "r", stdin)
#define Debug(x) for(int i = 0;i<x.size();++i)cout<<x[i]<<" ";cout<<endl
#define PUT(x) for(int i = 0;i<x.size();++i)cout<<x[i]<<" ";cout<<endl
#define ARRCIN(x) for(auto& i:x) cin>>i
#define LEN(x) to_string(x).size()
#define ALL(x) x.begin(),x.end()
#define _tostring(x) to_string(x);//自动保留负号
#define _toint(x) stoi(x);//stoi会自动将string数值部分的首位0消去，同时还会保留负号
#define _toll(x) stoll(x);
#define YES "YES\n"
#define NO "NO\n"
#define endl '\n'
#define int long long
using namespace std;
using i64 = unsigned long long;
using u64 = unsigned long long;
const int maxn = 2e5+10;
typedef long long LL;	
typedef long long llint;
typedef unsigned long long u64;
typedef pair<int, int> pii;
bool cmp(int a, int b) {return a > b;}
int qkpow(int a,int n,int mod = INF32) {int ans = 1;while(n){if(n&1) ans = (ans * a) % mod;a = (a * a) % mod;n >>= 1;}return (ans + mod) % mod;}
int gcd(int a,int b) {int tem = 0; while(b) tem = b,b = a % b,a = tem; return tem;}
int lcm(int a,int b) {return a * b / gcd(a, b);}
int lowbit(int x){return x & -x;}
std::mt19937_64 rng(time(0));
//裴蜀定理：
//	若a,b是整数,且gcd(a,b)=d，那么对于任意的整数x,y,ax+by都一定是d的倍数，特别地，一定存在整数x,y，使ax+by=d成立。
//	它的一个重要推论是：a,b互质的充要条件是存在整数x,y使ax+by=1.
//	另外，多元线性方程 a1x1 + a2x2 + ... + anxn = w  有解的充要条件是gcd(a1,a2,a3,...,an) | w
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//此处采用运算符重载的方式，还可以重载仿函数
struct node{
	int l, r, cnt, size, x, y, val;
	bool operator<(const node& a)const {return val<a.val;}//大根堆
};//思路：统计数量（0-9）；如果为0则忽略，不为零

const int N = 32;
bool solve() {
	int l, r;cin>>l>>r;
	bitset<N> bl(l), br(r);
	// cout<<bl<<endl<<br<<endl;
	
	int pos = 0;
	for(int i = N - 1;i >= 0;--i){
		if(bl[i] != br[i]) {
			pos = i;
			break;
		}
	}
	
	int a = 0, b = 0, c = 0;
	a = l | ((1 << pos) - 1);
	b = a + 1;
	
	for(int i = l+1;i <= r;++i){
		if(i != a && i != b){
			c = i;
			break;
		}
	}
	c = (a == l ? r : l);
	cout<<a<<" "<<b<<" "<<c<<endl;
	// cout<<(a ^ b) + (b ^ c) + (a ^ c)<<endl;
	return 1;
}

signed main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	if (!REDIRECT) fout, fin;
	int _ = 1;
	std::cin >> _;
	while (_--)
		solve();
	return 0;
}