ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#define ll long long
#define pi pair<int, int>
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define pb push_back
#define inf 1e9
using namespace std;

const int dim = 2e5+1, mod = 1e9+7;
int n, st, a[dim], aux[dim], i;

//void op1(int a[], int& st)
//{
//    reverse(a+st, a+n+1);
//}

void op2(int a[], int& st)
{
    int i;
    if (n-st+1 <= 1)
        return;
    st++;
    for (i = n; i >= st; i--)
        a[i] = a[i]-a[i-1];
//    cout << "a: ";
//    for (i = st; i <= n; i++)
//        cout << a[i] << ' ';
//    cout << endl;
}

ll sum(int a[], int& st)
{
    ll rez = 0;
    for (int i = st; i <= n; i++)
        rez += a[i];
    if (n > 1)
        return abs(rez);
    return rez;
}

void solve()
{
    cin >> n;
    st = 1;
    for (i = 1; i <= n; i++)
        cin >> a[i];//, aux[i] = a[i];
    ll rez = sum(a, st);
    while (n-st+1 > 1)
    {
        op2(a, st);
        rez = max(rez, sum(a, st));
    }
    cout << rez << '\n';
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    int t;
    cin >> t;
    while (t--)
        solve();
    return 0;
}


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#define ll long long
#define pi pair<int, int>
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define pb push_back
#define inf 1e9
using namespace std;

const int dim = 2e5+1, mod = 1e9+7;
int n, st, i;
ll a[dim];

//void op1(int a[], int& st)
//{
//    reverse(a+st, a+n+1);
//}

void op2(ll a[], int& st)
{
    int i;
    if (n-st+1 <= 1)
        return;
    st++;
    for (i = n; i >= st; i--)
        a[i] = a[i]-a[i-1];
//    cout << "a: ";
//    for (i = st; i <= n; i++)
//        cout << a[i] << ' ';
//    cout << endl;
}

ll sum(ll a[], int& st)
{
    ll rez = 0;
    for (int i = st; i <= n; i++)
        rez += a[i];
    if (n > 1)
        return abs(rez);
    return rez;
}

void solve()
{
    cin >> n;
    st = 1;
    for (i = 1; i <= n; i++)
        cin >> a[i];
    ll rez = sum(a, st);
    while (n-st+1 > 1)
    {
        op2(a, st);
        rez = max(rez, sum(a, st));
    }
    cout << rez << '\n';
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    int t;
    cin >> t;
    while (t--)
        solve();
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#define ll long long
#define pi pair<int, int>
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define pb push_back
#define inf 1e9
using namespace std;

const int dim = 2e5+1, mod = 1e9+7;
int n, st, i;
ll a[dim];

//void op1(int a[], int& st)
//{
//    reverse(a+st, a+n+1);
//}

void op2(ll a[], int& st)
{
    int i;
    if (n-st+1 <= 1)
        return;
    st++;
    for (i = n; i >= st; i--)
        a[i] = a[i]-a[i-1];
//    cout << "a: ";
//    for (i = st; i <= n; i++)
//        cout << a[i] << ' ';
//    cout << endl;
}

ll sum(ll a[], int& st)
{
    ll rez = 0;
    for (int i = st; i <= n; i++)
        rez += a[i];
    if (n > 1)
        return abs(rez);
    return rez;
}

void solve()
{
    cin >> n;
    st = 1;
    for (i = 1; i <= n; i++)
        cin >> a[i];
    ll rez = sum(a, st);
    while (n-st+1 > 1)
    {
        op2(a, st);
        rez = max(rez, sum(a, st));
    }
    cout << rez << '\n';
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    int t;
    cin >> t;
    while (t--)
        solve();
    return 0;
}


Submission (verdict: Accepted):
#include <bits/stdc++.h>
#define ll long long
#define pi pair<int, int>
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define pb push_back
#define inf 1e9
using namespace std;

const int dim = 2e5+1, mod = 1e9+7;
int n, st, i;
ll a[dim];

//void op1(int a[], int& st)
//{
//    reverse(a+st, a+n+1);
//}

void op2(ll a[], int& st)
{
    int i;
    if (n-st+1 <= 1)
        return;
    st++;
    for (i = n; i >= st; i--)
        a[i] = a[i]-a[i-1];
//    cout << "a: ";
//    for (i = st; i <= n; i++)
//        cout << a[i] << ' ';
//    cout << endl;
}

ll sum(ll a[], int& st)
{
    ll rez = 0;
    for (int i = st; i <= n; i++)
        rez += a[i];
    if (n > 1)
        return abs(rez);
    return rez;
}

void solve()
{
    cin >> n;
    st = 1;
    ll rez = 0;
    for (i = 1; i <= n; i++)
        cin >> a[i], rez += a[i];
    while (n-st+1 > 1)
    {
        op2(a, st);
        rez = max(rez, sum(a, st));
    }
    cout << rez << '\n';
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    int t;
    cin >> t;
    while (t--)
        solve();
    return 0;
}
Problem: 2050B - Transfusion
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

using namespace std;



int main() {

    int t;

    cin >> t;

    

    while (t--) {

        int n;

        cin >> n;



        int sumo = 0, sume = 0;

        int sizeo = 0, sizee = 0;

        

        for (int i = 0; i < n; i++) {

            int x;

            cin >> x;

            if (i % 2 == 0) {

                sume += x;

                sizee++;

            } else {

                sumo += x;

                sizeo++;

            }

        }



        if (sizeo == 0 || sizee == 0) {

            cout << "no" << endl;  // If one group is empty, they can't be equal

        } else if ((double)sume / sizee == (double)sumo / sizeo) {

            cout << "yes" << endl;

        } else {

            cout << "no" << endl;

        }

    }

    

    return 0;

}



Submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>

using namespace std;



int main() {

    int t;

    cin >> t;

    

    while (t--) {

        int n;

        cin >> n;



        int sumo = 0, sume = 0;

        int sizeo = 0, sizee = 0;

        

        for (int i = 0; i < n; i++) {

            int x;

            cin >> x;

            if (i % 2 == 0) {

                sume += x;

                sizee++;

            } else {

                sumo += x;

                sizeo++;

            }

        }



        if (sizeo == 0 || sizee == 0) {

            cout << "no" << endl; 

            // If one group is empty, they can't be equal

            

        }

        else if(sume%sizee!=0 || sumo%sizeo !=0 ){

            cout<<"NO"<<endl;

        }

        

        

        

        else if ((double)sume / sizee == (double)sumo / sizeo) {

            cout << "yes" << endl;

        } else {

            cout << "no" << endl;

        }

    }

    

    return 0;

}
Problem: 2050B - Transfusion
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>

using namespace std;



int main() {

    int t;

    cin >> t;

    

    while (t--) {

        int n;

        cin >> n;



        int sumo = 0, sume = 0;

        int sizeo = 0, sizee = 0;

        

        for (int i = 0; i < n; i++) {

            int x;

            cin >> x;

            if (i % 2 == 0) {

                sume += x;

                sizee++;

            } else {

                sumo += x;

                sizeo++;

            }

        }



        if (sizeo == 0 || sizee == 0) {

            cout << "no" << endl; 

            // If one group is empty, they can't be equal

            

        }

        else if(sume%sizee!=0 || sumo%sizeo !=0 ){

            cout<<"NO"<<endl;

        }

        

        

        

        else if ((double)sume / sizee == (double)sumo / sizeo) {

            cout << "yes" << endl;

        } else {

            cout << "no" << endl;

        }

    }

    

    return 0;

}



Submission (verdict: Accepted):
#include <bits/stdc++.h>

using namespace std;



int main() {

    int t;

    cin >> t;

    

    while (t--) {

        int n;

        cin >> n;



        long long sumo = 0, sume = 0;

        long long sizeo = 0, sizee = 0;

        

        for (int i = 0; i < n; i++) {

            int x;

            cin >> x;

            if (i % 2 == 0) {

                sume += x;

                sizee++;

            } else {

                sumo += x;

                sizeo++;

            }

        }



        if (sizeo == 0 || sizee == 0) {

            cout << "no" << endl; 

            // If one group is empty, they can't be equal

            

        }

        else if(sume%sizee!=0 || sumo%sizeo !=0 ){

            cout<<"NO"<<endl;

        }

        

        

        

        else if ((double)sume / sizee == (double)sumo / sizeo) {

            cout << "yes" << endl;

        } else {

            cout << "no" << endl;

        }

    }

    

    return 0;

}
Problem: 2050B - Transfusion
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>

using namespace std;



int main() {

    int t;

    cin >> t;

    

    while (t--) {

        int n;

        cin >> n;



        int sumo = 0, sume = 0;

        int sizeo = 0, sizee = 0;

        

        for (int i = 0; i < n; i++) {

            int x;

            cin >> x;

            if (i % 2 == 0) {

                sume += x;

                sizee++;

            } else {

                sumo += x;

                sizeo++;

            }

        }



        if (sizeo == 0 || sizee == 0) {

            cout << "no" << endl;  // If one group is empty, they can't be equal

        } else if ((double)sume / sizee == (double)sumo / sizeo) {

            cout << "yes" << endl;

        } else {

            cout << "no" << endl;

        }

    }

    

    return 0;

}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 8):
#include <bits/stdc++.h>
using namespace std;
int main() {
   
   int t;
   cin>>t;
   
   while(t--){
       int n,l,r;
       cin>>n>>l>>r;
       
       vector<int> v(n);
       
       for(int i=0;i<n;i++){
           cin>>v[i];
           
       }
       
       vector<int> vrr;
       vector<int> brr;
       
       for(int i=0;i<n;i++){
           if(i >=0 && i<=r-1){
               vrr.push_back(v[i]);
           }
       }
       
       for(int j=0;j<n;j++){
           if(j>=l-1 && j<=n-1){
               brr.push_back(v[j]);
           }
       }
       
       sort(vrr.begin(),vrr.end());
       sort(brr.begin(),brr.end());
       
       int sum1=0;
       int sum2=0;
       
       for(int i=0;i<r-l+1;i++){
           sum1=sum1+vrr[i];
           
       }
       for(int i=0;i<r-l+1;i++){
           sum2=sum2+brr[i];
       }
       
       int mini=min(sum1,sum2);
       
       cout<<mini<<endl;
       
      
       
       
   }  
   return 0;
   
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>

using namespace std;

int main() {

   

   int t;

   cin>>t;

   

   while(t--){

       int n,l,r;

       cin>>n>>l>>r;

       

       vector<int> v(n);

       

       for(int i=0;i<n;i++){

           cin>>v[i];

           

       }

       

       vector<int> vrr;

       vector<int> brr;

       

       for(int i=0;i<n;i++){

           if(i >=0 && i<=r-1){

               vrr.push_back(v[i]);

           }

       }

       

       for(int j=0;j<n;j++){

           if(j>=l-1 && j<=n-1){

               brr.push_back(v[j]);

           }

       }

       

       sort(vrr.begin(),vrr.end());

       sort(brr.begin(),brr.end());

       

       long long sum1=0;

       long long sum2=0;

       

       for(int i=0;i<r-l+1;i++){

           sum1=sum1+vrr[i];

           

       }

       for(int i=0;i<r-l+1;i++){

           sum2=sum2+brr[i];

       }

       

       long long mini=min(sum1,sum2);

       

       cout<<mini<<endl;

       

      

       

       

   }  

   return 0;

   

}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
int main() {
   
   int t;
   cin>>t;
   
   while(t--){
       int n,l,r;
       cin>>n>>l>>r;
       
       vector<int> v(n);
       
       for(int i=0;i<n;i++){
           cin>>v[i];
           
       }
       
       sort(v.begin(),v.end());
       int ans=0;
       for(int i=0;i<r-l+1;i++){
           ans =ans+ v[i];
       }
       
       cout<<ans<<endl;
   }  
   return 0;
   
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
int main() {
   
   int t;
   cin>>t;
   
   while(t--){
       int n,l,r;
       cin>>n>>l>>r;
       
       vector<int> v(n);
       
       for(int i=0;i<n;i++){
           cin>>v[i];
           
       }
       
       sort(v.begin(),v.end());
       int ans=0;
       for(int i=0;i<r-l+1;i++){
           ans =ans+ v[i];
       }
       
       cout<<ans<<endl;
   }  
   return 0;
   
}

Submission (verdict: Wrong answer on test 8):
#include <bits/stdc++.h>
using namespace std;
int main() {
   
   int t;
   cin>>t;
   
   while(t--){
       int n,l,r;
       cin>>n>>l>>r;
       
       vector<int> v(n);
       
       for(int i=0;i<n;i++){
           cin>>v[i];
           
       }
       
       vector<int> vrr;
       vector<int> brr;
       
       for(int i=0;i<n;i++){
           if(i >=0 && i<=r-1){
               vrr.push_back(v[i]);
           }
       }
       
       for(int j=0;j<n;j++){
           if(j>=l-1 && j<=n-1){
               brr.push_back(v[j]);
           }
       }
       
       sort(vrr.begin(),vrr.end());
       sort(brr.begin(),brr.end());
       
       int sum1=0;
       int sum2=0;
       
       for(int i=0;i<r-l+1;i++){
           sum1=sum1+vrr[i];
           
       }
       for(int i=0;i<r-l+1;i++){
           sum2=sum2+brr[i];
       }
       
       int mini=min(sum1,sum2);
       
       cout<<mini<<endl;
       
      
       
       
   }  
   return 0;
   
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
// #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <array>
#include <unordered_map>
#include <climits>

using namespace std;

#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vvi vector<vector<int>>
#define vvll vector<vector<ll>>
#define fr(i, a, b) for (int i = a; i < b; i++)
#define all(a) a.begin(), a.end()

int mod = 1e9 + 7;

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int tt = 1;
    cin >> tt;
    while (tt--)
    {
    
    int n;
    cin >> n;
    vll a(n);
    fr(i, 0, n)
    {
        cin >> a[i];
    }
    bool poss = true;
    fr(i, 1, n)
    {
        if(a[i] > a[i - 1])
        {
            poss = true;
            break;
        }
        else if(a[i] < a[i - 1])
        {
            poss = false;
            break;
        }
    }
    if(poss)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
    }
}

Submission (verdict: Wrong answer on test 2):
// #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <array>
#include <unordered_map>
#include <climits>

using namespace std;

#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vvi vector<vector<int>>
#define vvll vector<vector<ll>>
#define fr(i, a, b) for (int i = a; i < b; i++)
#define all(a) a.begin(), a.end()

int mod = 1e9 + 7;

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int tt = 1;
    cin >> tt;
    while (tt--)
    {
    
    int n;
    cin >> n;
    vll a(n);
    fr(i, 0, n)
    {
        cin >> a[i];
    }
    bool poss = true;
    fr(i, 1, n)
    {
        if(a[i] > a[i - 1])
        {
            a[i] = a[i] - a[i - 1];
            a[i - 1] = 0;
        }
        else if(a[i] < a[i - 1])
        {
            poss = false;
            break;
        }
    }
    if(poss)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
    }
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
// #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <array>
#include <unordered_map>
#include <climits>

using namespace std;

#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vvi vector<vector<int>>
#define vvll vector<vector<ll>>
#define fr(i, a, b) for (int i = a; i < b; i++)
#define all(a) a.begin(), a.end()

int mod = 1e9 + 7;

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int tt = 1;
    cin >> tt;
    while (tt--)
    {
    
    int n;
    cin >> n;
    vll a(n);
    fr(i, 0, n)
    {
        cin >> a[i];
    }
    bool poss = true;
    fr(i, 1, n)
    {
        if(a[i] > a[i - 1])
        {
            poss = true;
            break;
        }
        else if(a[i] < a[i - 1])
        {
            poss = false;
            break;
        }
    }
    if(poss)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
    }
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
// #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <array>
#include <unordered_map>
#include <climits>

using namespace std;

#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vvi vector<vector<int>>
#define vvll vector<vector<ll>>
#define fr(i, a, b) for (int i = a; i < b; i++)
#define all(a) a.begin(), a.end()

int mod = 1e9 + 7;

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int tt = 1;
    cin >> tt;
    while (tt--)
    {
    
    int n;
    cin >> n;
    vll a(n);
    fr(i, 0, n)
    {
        cin >> a[i];
    }
    bool poss = true;
    fr(i, 1, n)
    {
        if(a[i] > a[i - 1])
        {
            a[i] = a[i] - a[i - 1];
            a[i - 1] = 0;
        }
        else if(a[i] < a[i - 1])
        {
            poss = false;
            break;
        }
    }
    if(poss)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
    }
}

Submission (verdict: Accepted):
// #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <array>
#include <unordered_map>
#include <climits>

using namespace std;

#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vvi vector<vector<int>>
#define vvll vector<vector<ll>>
#define fr(i, a, b) for (int i = a; i < b; i++)
#define all(a) a.begin(), a.end()

int mod = 1e9 + 7;

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int tt = 1;
    cin >> tt;
    while (tt--)
    {
    
    int n;
    cin >> n;
    vll a(n);
    fr(i, 0, n)
    {
        cin >> a[i];
    }
    bool poss = true;
    fr(i, 1, n)
    {
        if(a[i] >= a[i - 1])
        {
            a[i] = a[i] - a[i - 1];
            a[i - 1] = 0;
        }
        else if(a[i] < a[i - 1])
        {
            poss = false;
            break;
        }
    }
    if(poss)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
    }
}
Problem: 2063C - Remove Exactly Two
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define ll long long
#define lld long double
#define el '\n'
#define ws " "
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define nai cout << "-1\n"
#define pbk push_back
#define mkp make_pair
#define ii pair<int, int>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define dbg(x) cout << #x << " " << x << "\n"
typedef vector<int> vi;
typedef vector<ll> vl;

template<class T>
void print(T& a)
{
    for(auto x : a)
        cout << x << " ";
    cout << "\n";
}

void dfs(int vtx, vector<vi>&adj, vi&visited) {
    visited[vtx] = 1;

    for (int nd : adj[vtx]) {
        if (!visited[nd])
            dfs(nd, adj, visited);
    }
}

void solve(int tc)
{
    int n; cin >> n;

    vector<vi> adj(n + 1); 
    vi visited(n + 1);
    rep(i, n - 1) {
        int u, v; cin >> u >> v;
        adj[u].pbk(v);
        adj[v].pbk(u);
    }

    vi node(2);
    for (int i = 0; i < 2; i++) {
        int mx = INT_MIN;
        for (int ver = 1; ver <= n; ver++) {
            if (mx < (int)adj[ver].size() && !visited[ver]) {
                node[i] = ver; 
                mx = adj[ver].size();
            }
        }
        
        visited[node[i]] = 1;
        for (int nd : adj[node[i]]) {
            adj[nd].erase(remove(all(adj[nd]), node[i]), adj[nd].end());
        }
    }

    int ans = 0;
    for (int i = 1; i <= n; i++) {
        if (!visited[i]) {
            ans++;
            dfs(i, adj, visited);
        }
    }
    cout << ans << el;
}

int32_t main(void)
{
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int t = 1;
    cin >> t;
    for (int i = 1; i <= t; i++)
        solve(i);
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define endl '\n';
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define char unsigned char

typedef long long ll;
typedef long double ld;

void solve() {
  int l, r;
  cin >> l >> r;
  ll x = l ^ r;
  ll xx = __builtin_clz(x);
  ll idx = 32 - xx - 1;
  ll y = 1 << (idx + 1);
  ll a, b, c;
  a = l & (~y);
  a = a | ((1 << idx) - 1);
  a = a & (~(1 << idx));
  b = l & (~y);
  b += 1 << idx;
  for (int i = l; i <= r; i++) {
    if (i != a && i != c) {
      c = i;
      break;
    }
  }
  cout << a << ' ' << b << ' ' << c << endl;
  return;
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);

  int TET = 1;
  cin >> TET;

  while (TET--) {
    solve();
  }
}


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define endl '\n';
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define char unsigned char

typedef long long ll;
typedef long double ld;

void solve() {
  int l, r;
  cin >> l >> r;
  int x = l ^ r;
  int idx = 31 - __builtin_clz(x);
  int a, b, c;
  a = l | ((1 << idx) - 1);
  b = a + 1;
  for (int i = l; i <= r; i++) {
    if (i != a && i != c) {
      c = i;
      break;
    }
  }

  cout << a << ' ' << b << ' ' << c << endl;
  return;
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);

  int TET = 1;
  cin >> TET;

  while (TET--) {
    solve();
  }
}