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

Code 1:
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>

using namespace std;

int l, r;

int main()
{
    int T;
    scanf("%d", &T);
    while (T --)
    {
        scanf("%d%d", &l, &r);
        int t = l ^ r;
        int start;
        for (int i = 30; i >= 0; i --)
            if (t >> i & 1)
            {
                start = i;
                break;
            }
        // cout << "start:" << start << endl;
        int a = 0, b = 0, c = 0;
        if ((t >> (start - 1)) == 1)
        {
            a = (1 << start), b = (1 << start) - 1;
            a = a + (l >> start << start), b = b + (l >> start << start);
            for (int i = l; i <= r; i ++)
                if (i != a && i != b)
                {
                    c = i;
                    break;
                }
        }
        else
        {
            a = (1 << start), b = (1 << (start - 1));
            for (int i = start - 2; i >= 0; i --)
            {
                if (t >> i & 1)
                {
                    if (l >> i & 1) b = b + (1 << i);
                    else    a = a + (1 << i);
                }
                else
                {
                    b = b + (1 << i);
                }
            }
            a = a + (l >> start << start), b = b + (l >> start << start);
            for (int i = l; i <= r; i ++)
                if (i != a && i != b)
                {
                    c = i;
                    break;
                }
        }
        // cout << "start:" << start << endl;
        printf("%d %d %d\n", a, b, c);
        // printf("%d\n", (a ^ b) + (a ^ c) + (b ^ c));
        // printf("%d\n", (123 ^ 121) + (123 ^ 118) + (121 ^ 118));//123 121 118
    }

    return 0;
}

Code 2:
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>

using namespace std;

int l, r;

int main()
{
    int T;
    scanf("%d", &T);
    while (T --)
    {
        scanf("%d%d", &l, &r);
        int t = l ^ r;
        int start;
        for (int i = 30; i >= 0; i --)
            if (t >> i & 1)
            {
                start = i;
                break;
            }
        // cout << "start:" << start << endl;
        int a = 0, b = 0, c = 0;
        if ((t >> (start - 1)) == 1)
        {
            a = (1 << start), b = (1 << start) - 1;
            for (int i = l; i <= r; i ++)
                if (i != a && i != b)
                {
                    c = i;
                    break;
                }
        }
        else
        {
            a = (1 << start), b = (1 << (start - 1));
            for (int i = start - 2; i >= 0; i --)
            {
                if (t >> i & 1)
                {
                    if (l >> i & 1) b = b + (1 << i);
                    else    a = a + (1 << i);
                }
                else
                {
                    b = b + (1 << i);
                }
            }
            for (int i = l; i <= r; i ++)
                if (i != a && i != b)
                {
                    c = i;
                    break;
                }
        }
        // cout << "start:" << start << endl;
        a = a + (l >> start << start), b = b + (l >> start << start);
        printf("%d %d %d\n", a, b, c);
        // printf("%d\n", (a ^ b) + (a ^ c) + (b ^ c));
        // printf("%d\n", (123 ^ 121) + (123 ^ 118) + (121 ^ 118));//123 121 118
    }

    return 0;
}

Answer: 1