ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
#define FASTIO                    \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
#define ll long long
#define For(i, a, b) for (ll i = a; i < b; i++)
#define Rfor(i, a, b) for (ll i = a; i >= b; i--)
#define srt(a) sort(a.begin(), a.end())
#define all(a) a.begin(), a.end()
#define rsrt(a) sort(a.rbegin(), a.rend())
#define pb push_back
using namespace std;
int main()
{
    FASTIO;
    ll t = 1;
    cin >> t;
    while (t--)
    {
        string s;
        cin >> s;
        ll sum = 0;
        map<char, ll> mp;
        For(i, 0, s.size())
        {
            sum += s[i] - '0';
            mp[s[i]]++;
        }
        sum %= 9;
        //cout << "sum: " << sum << "\n";
        if (sum == 0)
        {
            cout << "YES\n";
            continue;
        }
        else if (sum == 1)
        {
            if ((mp['2'] >= 4) || (mp['3'] >= 1 && mp['2'] >= 1))
                cout << "YES\n";
            else
                cout << "NO\n";
        }
        else if (sum == 2)
        {
            if ((mp['3'] >= 2 && mp['2'] >= 2) || (mp['2'] >= 8) || (mp['3'] >= 1 && mp['2'] >= 5))
                cout << "YES\n";
            else
                cout << "NO\n";
        }
        else if (sum == 3)
        {
            if (mp['3'] > 0 || mp['2'] >= 3)
                cout << "YES\n";
            else
                cout << "NO\n";
        }
        else if (sum == 4)
        {
            if ((mp['2'] >= 7) || (mp['3'] >= 2 && mp['2'] >= 1) || (mp['3'] >= 1 && mp['2'] >= 4))
                cout << "YES\n";
            else
                cout << "NO\n";
        }
        else if (sum == 5)
        {
            if (mp['2'] >= 2)
                cout << "YES\n";
            else
                cout << "NO\n";
        }
        else if (sum == 6)
        {
            if (mp['3'] >= 2 || mp['2'] >= 6)
                cout << "YES\n";
            else
                cout << "NO\n";
        }
        else if (sum == 7)
        {
            if (mp['2'] >= 1)
                cout << "YES\n";
            else
                cout << "NO\n";
        }
        else if (sum == 8)
        {
            if (mp['3'] >= 1 && mp['2'] >= 2)
                cout << "YES\n";
            else
                cout << "NO\n";
        }
    }
    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>
using namespace std;
#define int long long
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;

void solve(){
    int n;
    cin>>n;
    vector<int> nums(n,0);
    
    for(int i=0;i<n;i++){
        cin>>nums[i];
    }

    if(nums[0]<nums[1]){
        cy;
    }else{
        cn;
    }
    
    
    return;
}


int32_t main() {
    
    int t;
    cin >> t;

    
    while (t--) {
        solve();
    }
    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;

void solve(){
    int n;
    cin>>n;
    vector<int> nums(n,0);
    
    for(int i=0;i<n;i++){
        cin>>nums[i];
    }

    for(int i=1;i<n;i++){
        if(nums[i-1]<nums[i]){
            int temp=nums[i-1];
            nums[i-1]-=temp;
            nums[i]-=temp;
        }else{
            cn;
            return;
        }
    }

    cy;
    
    
    return;
}


int32_t main() {
    
    int t;
    cin >> t;

    
    while (t--) {
        solve();
    }
    return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;

void solve(){
    int n;
    cin>>n;
    vector<int> nums(n,0);
    
    for(int i=0;i<n;i++){
        cin>>nums[i];
    }

    if(nums[0]<nums[1]){
        cy;
    }else{
        cn;
    }
    
    
    return;
}


int32_t main() {
    
    int t;
    cin >> t;

    
    while (t--) {
        solve();
    }
    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>
using namespace std;
#define int long long
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;

void solve(){
    int n;
    cin>>n;
    vector<int> nums(n,0);
    
    for(int i=0;i<n;i++){
        cin>>nums[i];
    }

    for(int i=1;i<n;i++){
        if(nums[i-1]<nums[i]){
            int temp=nums[i-1];
            nums[i-1]-=temp;
            nums[i]-=temp;
        }else{
            cn;
            return;
        }
    }

    cy;
    
    
    return;
}


int32_t main() {
    
    int t;
    cin >> t;

    
    while (t--) {
        solve();
    }
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;

void solve(){
    int n;
    cin>>n;
    vector<int> nums(n,0);
    
    for(int i=0;i<n;i++){
        cin>>nums[i];
    }

    for(int i=1;i<n;i++){
        if(nums[i-1]<=nums[i]){
            int temp=nums[i-1];
            nums[i-1]-=temp;
            nums[i]-=temp;
        }else{
            cn;
            return;
        }
    }

    cy;
    
    
    return;
}


int32_t main() {
    
    int t;
    cin >> t;

    
    while (t--) {
        solve();
    }
    return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)

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



using namespace std;

typedef long long ll;

typedef long double ld;

#define pb push_back

#define dbg(x) //cerr<<#x<<": "<<x<<"\n";



void code(){

    int n,m;

    cin>>n>>m;

    ll a[n], b[m];

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

        cin>>a[i];

    }

    multiset<ll>ms;

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

        cin>>b[i];

        ms.insert(b[i]);

    }

    sort(a,a+n);

    sort(b,b+m);

    ll sum=0;

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

        sum+=a[i];

        if(ms.count(sum)){

            ms.erase(ms.find(sum));

            sum=0;

        }

        else if(i<n && a[i+1]-sum>1){

            cout<<"No\n";

            return;

        }

    }

    if(ms.empty()){

        cout<<"Yes\n";

    }

    else{

        cout<<"No\n";

    }

}

int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    //cout.tie(NULL);

    cout.precision(10);

    cout<<fixed;

    int t=1;

    cin>>t;

    for(int i=1;i<=t;i++){

        dbg("case"+to_string(i));

        //cout<<"Case "<<i<<":\n";

        code();

    }

}



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



using namespace std;

typedef long long ll;

typedef long double ld;

#define pb push_back

#define dbg(x) //cerr<<#x<<": "<<x<<"\n";



void code(){

    int n,m;

    cin>>n>>m;

    ll a[n], b[m];

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

        cin>>a[i];

    }

    multiset<ll>ms;

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

        cin>>b[i];

        ms.insert(b[i]);

    }

    sort(a,a+n);

    sort(b,b+m);

    ll sum=0;

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

        sum+=a[i];

        if(ms.empty()){

            cout<<"No\n";

            return;

        }

        else if(ms.count(sum)){

            ms.erase(ms.find(sum));

            sum=0;

        }

        else if(i<n-1 && a[i+1]-sum>1){

            cout<<"No\n";

            return;

        }

    }

    if(ms.empty()){

        cout<<"Yes\n";

    }

    else{

        cout<<"No\n";

    }

}

int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    //cout.tie(NULL);

    cout.precision(10);

    cout<<fixed;

    int t=1;

    cin>>t;

    for(int i=1;i<=t;i++){

        dbg("case"+to_string(i));

        //cout<<"Case "<<i<<":\n";

        code();

    }

}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)

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



using namespace std;

typedef long long ll;

typedef long double ld;

#define pb push_back

#define dbg(x) //cerr<<#x<<": "<<x<<"\n";



void code(){

    int n,m;

    cin>>n>>m;

    ll a[n], b[m];

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

        cin>>a[i];

    }

    multiset<ll>ms;

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

        cin>>b[i];

        ms.insert(b[i]);

    }

    sort(a,a+n);

    sort(b,b+m);

    ll sum=0;

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

        sum+=a[i];

        if(ms.empty()){

            cout<<"No\n";

            return;

        }

        else if(ms.count(sum)){

            ms.erase(ms.find(sum));

            sum=0;

        }

        else if(i<n-1 && a[i+1]-sum>1){

            cout<<"No\n";

            return;

        }

    }

    if(ms.empty()){

        cout<<"Yes\n";

    }

    else{

        cout<<"No\n";

    }

}

int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    //cout.tie(NULL);

    cout.precision(10);

    cout<<fixed;

    int t=1;

    cin>>t;

    for(int i=1;i<=t;i++){

        dbg("case"+to_string(i));

        //cout<<"Case "<<i<<":\n";

        code();

    }

}



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



using namespace std;

typedef long long ll;

typedef long double ld;

#define pb push_back

#define dbg(x) //cerr<<#x<<": "<<x<<"\n";

map<ll,int>mp;

bool ok(ll x){

    if(mp.count(x) && mp[x]>0){

        mp[x]--;

        return true;

    }

    if(x==1){

        return false;

    }

    if(ok(x/2)&&ok((x+1)/2)){

        return true;

    }

    return false;

}

void code(){

    mp.clear();

    int n,m;

    cin>>n>>m;

    ll a[n],b[m];

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

        cin>>a[i];

        mp[a[i]]++;

    }

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

        cin>>b[i];

    }

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

        if(!ok(b[i])){

            cout<<"No\n";

            mp.clear();

            return;

        }

    }

    for(auto it:mp){

        if(it.second>0){

            cout<<"No\n";

            mp.clear();

            return;

        }

    }

    cout<<"Yes\n";

    mp.clear();

}

int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    //cout.tie(NULL);

    cout.precision(10);

    cout<<fixed;

    int t=1;

    cin>>t;

    for(int i=1;i<=t;i++){

        dbg("case"+to_string(i));

        //cout<<"Case "<<i<<":\n";

        code();

    }

}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)


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



using namespace std;

typedef long long ll;

typedef long double ld;

#define pb push_back

#define dbg(x) //cerr<<#x<<": "<<x<<"\n";



void code(){

    int n,m;

    cin>>n>>m;

    ll a[n], b[m];

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

        cin>>a[i];

    }

    multiset<ll>ms;

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

        cin>>b[i];

        ms.insert(b[i]);

    }

    sort(a,a+n);

    sort(b,b+m);

    ll sum=0;

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

        sum+=a[i];

        if(ms.count(sum)){

            ms.erase(ms.find(sum));

            sum=0;

        }

        else if(i<n && a[i+1]-sum>1){

            cout<<"No\n";

            return;

        }

    }

    if(ms.empty()){

        cout<<"Yes\n";

    }

    else{

        cout<<"No\n";

    }

}

int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    //cout.tie(NULL);

    cout.precision(10);

    cout<<fixed;

    int t=1;

    cin>>t;

    for(int i=1;i<=t;i++){

        dbg("case"+to_string(i));

        //cout<<"Case "<<i<<":\n";

        code();

    }

}
Problem: 2060D - Subtract Min Sort
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
///...... In the name of ALLAH ......///



#include<bits/stdc++.h>

#define int long long

#define dbg(x) cout << #x << ": " << x << '\n';

using namespace std;





void solve () {

   int n; cin >> n;

   int a[n + 1];

   a[0] = 0;

   for (int i = 1; i <= n; i++) cin >> a[i];

   string ans = "YES";

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

     if (a[i] > a[i + 1] && a[i - 1] + a[i + 1] >= a[i]) {

        a[i] -= a[i - 1];

        a[i - 1] = 0;

     }

     else if (a[i] > a[i + 1] && a[i] > a[i - 1] + a[i + 1]) {

        ans = "NO";

        break;

     }

   }



   cout << ans << '\n';

}

 

int32_t main () {

  ios_base::sync_with_stdio(0); cin.tie(0);



  int t = 1; cin >> t;



  while (t--) {

     solve ();

  }



  return 0;

}

Submission (verdict: Wrong answer on test 2):
///...... In the name of ALLAH ......///



#include<bits/stdc++.h>

#define int long long

#define dbg(x) cout << #x << ": " << x << '\n';

using namespace std;





void solve () {

   int n; cin >> n;

   int a[n + 1];

   a[0] = 0;  

   for (int i = 1; i <= n; i++) cin >> a[i];

   string ans = "YES";

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

     if (a[i] > a[i + 1] && a[i - 1] + a[i + 1] >= a[i]) {

        a[i] -= min (a[i - 1], a[i]);

        a[i - 1] -= min (a[i - 1], a[i]);

     }

     else if (a[i] > a[i + 1] && a[i] > a[i - 1] + a[i + 1]) {

        ans = "NO";

        break;

     }

   }



   cout << ans << '\n';

}

 

int32_t main () {

  ios_base::sync_with_stdio(0); cin.tie(0);



  int t = 1; cin >> t;



  while (t--) {

     solve ();

  }



  return 0;

}
Problem: 2060D - Subtract Min Sort
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
///...... In the name of ALLAH ......///



#include<bits/stdc++.h>

#define int long long

#define dbg(x) cout << #x << ": " << x << '\n';

using namespace std;





void solve () {

   int n; cin >> n;

   int a[n + 1];

   a[0] = 0;  

   for (int i = 1; i <= n; i++) cin >> a[i];

   string ans = "YES";

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

     if (a[i] > a[i + 1] && a[i - 1] + a[i + 1] >= a[i]) {

        a[i] -= min (a[i - 1], a[i]);

        a[i - 1] -= min (a[i - 1], a[i]);

     }

     else if (a[i] > a[i + 1] && a[i] > a[i - 1] + a[i + 1]) {

        ans = "NO";

        break;

     }

   }



   cout << ans << '\n';

}

 

int32_t main () {

  ios_base::sync_with_stdio(0); cin.tie(0);



  int t = 1; cin >> t;



  while (t--) {

     solve ();

  }



  return 0;

}

Submission (verdict: Wrong answer on test 2):
///...... In the name of ALLAH ......///



#include<bits/stdc++.h>

#define int long long

#define dbg(x) cout << #x << ": " << x << '\n';

using namespace std;





void solve () {

   int n; cin >> n;

   int a[n + 1];

   a[0] = 0;  

   for (int i = 1; i <= n; i++) cin >> a[i];

   string ans = "YES";

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

     if (a[i] > a[i + 1] && a[i - 1] + a[i + 1] >= a[i]) {

        int mn = min (a[i - 1], a[i]);

        a[i] -= mn;

        a[i - 1] -= mn;

     }

     else if (a[i] > a[i + 1] && a[i] > a[i - 1] + a[i + 1]) {

        ans = "NO";

        break;

     }

   }



   cout << ans << '\n';

}

 

int32_t main () {

  ios_base::sync_with_stdio(0); cin.tie(0);



  int t = 1; cin >> t;



  while (t--) {

     solve ();

  }



  return 0;

}
Problem: 2060D - Subtract Min Sort
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 2):
///...... In the name of ALLAH ......///



#include<bits/stdc++.h>

#define int long long

#define dbg(x) cout << #x << ": " << x << '\n';

using namespace std;





void solve () {

   int n; cin >> n;

   int a[n + 1];

   a[0] = 0;

   for (int i = 1; i <= n; i++) cin >> a[i];

   string ans = "YES";

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

     if (a[i] > a[i + 1] && a[i - 1] + a[i + 1] >= a[i]) {

        a[i] -= a[i - 1];

        a[i - 1] = 0;

     }

     else if (a[i] > a[i + 1] && a[i] > a[i - 1] + a[i + 1]) {

        ans = "NO";

        break;

     }

   }



   cout << ans << '\n';

}

 

int32_t main () {

  ios_base::sync_with_stdio(0); cin.tie(0);



  int t = 1; cin >> t;



  while (t--) {

     solve ();

  }



  return 0;

}
Problem: 2060D - Subtract Min Sort
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
///...... In the name of ALLAH ......///



#include<bits/stdc++.h>

#define int long long

#define dbg(x) cout << #x << ": " << x << '\n';

using namespace std;





void solve () {

   int n; cin >> n;

   int a[n + 1];

   a[0] = 0;  

   for (int i = 1; i <= n; i++) cin >> a[i];

   string ans = "YES";

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

     if (a[i] > a[i + 1] && a[i - 1] + a[i + 1] >= a[i]) {

        int mn = min (a[i - 1], a[i]);

        a[i] -= mn;

        a[i - 1] -= mn;

     }

     else if (a[i] > a[i + 1] && a[i] > a[i - 1] + a[i + 1]) {

        ans = "NO";

        break;

     }

   }



   cout << ans << '\n';

}

 

int32_t main () {

  ios_base::sync_with_stdio(0); cin.tie(0);



  int t = 1; cin >> t;



  while (t--) {

     solve ();

  }



  return 0;

}

Submission (verdict: Accepted):
///...... In the name of ALLAH ......///



#include<bits/stdc++.h>

#define int long long

#define dbg(x) cout << #x << ": " << x << '\n';

using namespace std;





void solve () {

   int n; cin >> n;

   int a[n + 1];

   a[0] = 0;  

   for (int i = 1; i <= n; i++) cin >> a[i];

   string ans = "YES";

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

     if (a[i] > a[i + 1] && a[i] > a[i - 1] + a[i + 1]) {

        ans = "NO";

        cout << ans << '\n';

        return;

     }

     else {

       int mn = min (a[i - 1], a[i]);

        a[i] -= mn;

        a[i - 1] -= mn;

     }

   }



   if (is_sorted(a, a + n + 1)) {

      cout << "YES" << '\n';

   }

   else {

    cout << "NO" << '\n';

   }

}

 

int32_t main () {

  ios_base::sync_with_stdio(0); cin.tie(0);



  int t = 1; cin >> t;



  while (t--) {

     solve ();

  }



  return 0;

}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
using namespace std;
#define mod 1000000007

ll lcm(ll a,ll b){
   return (a*b)/(__gcd(a,b));
}

ll LCM(const vector<ll> &d){
   ll result=d[0];
   for(int i=1;i<d.size();++i){
     result=lcm(result , d[i]);
   }
   return result;
}

void solve(){
   ll l,r;cin>>l>>r;
   bitset<64> L(l),R(r),a,b,c;
   int count=0;
   int j=0;
   int k=64;
   for(int i=63;i>=0;--i){
      if(R[i]){
         if(count > 1){
            a[i]=0;
            k=i;
            break;
         }
         a[i]=1;
         j=i;
         count++;
      }
   }
   for(int i=63;i>=0;--i){
      if(L[i]){
         b[i]=L[i];
         c[i]=L[i];
      }
   }
   for(int i=j-1;i>=0;--i){
      if(b[i]!=1 && c[i]!=1){
         c[i]=1;
      }
   }
   ll x=a.to_ullong();
   ll y=b.to_ullong();
   ll z=c.to_ullong();
   cout<<x<<" "<<y<<" "<<z<<endl;
}

int main(){
   std::ios::sync_with_stdio(false);
   std::cin.tie(nullptr);
   /*freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);*/
   int t;cin>>t;
   for(int i=1;i<=t;++i){
      //cout<<"Case #"<<i<<": ";
      solve();
   }
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
using namespace std;
#define mod 1000000007

ll lcm(ll a,ll b){
   return (a*b)/(__gcd(a,b));
}

ll LCM(const vector<ll> &d){
   ll result=d[0];
   for(int i=1;i<d.size();++i){
     result=lcm(result , d[i]);
   }
   return result;
}

void solve(){
   ll l,r;cin>>l>>r;
   if(r-l==2){
      cout<<l<<" "<<l+1<<" "<<r<<endl;
      return;
   }
   bitset<64> L(l),R(r),a,b,c;
   int count=0;
   int j=0;
   for(int i=63;i>=0;--i){
      if(R[i]){
         if(count > 1) break;
         a[i]=1;
         j=i;
         count++;
      }
   }
   for(int i=63;i>=0;--i){
      if(L[i]){
         b[i]=L[i];
         c[i]=L[i];
      }
   }
   for(int i=j-1;i>=0;--i){
      if(b[i]!=1 && c[i]!=1){
         c[i]=1;
      }
   }
   ll x=a.to_ullong();
   ll y=b.to_ullong();
   ll z=c.to_ullong();
   cout<<x<<" "<<y<<" "<<z<<endl;
}

int main(){
   std::ios::sync_with_stdio(false);
   std::cin.tie(nullptr);
   /*freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);*/
   int t;cin>>t;
   for(int i=1;i<=t;++i){
      //cout<<"Case #"<<i<<": ";
      solve();
   }
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
using namespace std;
#define mod 1000000007

ll lcm(ll a,ll b){
   return (a*b)/(__gcd(a,b));
}

ll LCM(const vector<ll> &d){
   ll result=d[0];
   for(int i=1;i<d.size();++i){
     result=lcm(result , d[i]);
   }
   return result;
}

void solve(){
   ll l,r;cin>>l>>r;
   bitset<64> L(l),R(r),a,b,c;
   int count=0;
   int j=0;
   int k=64;
   for(int i=63;i>=0;--i){
      if(R[i]){
         if(count > 1){
            a[i]=0;
            k=i;
            break;
         }
         a[i]=1;
         j=i;
         count++;
      }
   }
   for(int i=63;i>=0;--i){
      if(L[i]){
         b[i]=L[i];
         c[i]=L[i];
      }
   }
   for(int i=j-1;i>=0;--i){
      if(b[i]!=1 && c[i]!=1){
         c[i]=1;
      }
   }
   ll x=a.to_ullong();
   ll y=b.to_ullong();
   ll z=c.to_ullong();
   cout<<x<<" "<<y<<" "<<z<<endl;
}

int main(){
   std::ios::sync_with_stdio(false);
   std::cin.tie(nullptr);
   /*freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);*/
   int t;cin>>t;
   for(int i=1;i<=t;++i){
      //cout<<"Case #"<<i<<": ";
      solve();
   }
}
Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
using namespace std;
#define mod 1000000007

ll lcm(ll a,ll b){
   return (a*b)/(__gcd(a,b));
}

ll LCM(const vector<ll> &d){
   ll result=d[0];
   for(int i=1;i<d.size();++i){
     result=lcm(result , d[i]);
   }
   return result;
}

void solve(){
   ll l,r;cin>>l>>r;
   if(r-l==2){
      cout<<l<<" "<<l+1<<" "<<r<<endl;
      return;
   }
   bitset<64> L(l),R(r),a,b,c;
   int count=0;
   int j=0;
   for(int i=63;i>=0;--i){
      if(R[i]){
         if(count > 1) break;
         a[i]=1;
         j=i;
         count++;
      }
   }
   for(int i=63;i>=0;--i){
      if(L[i]){
         b[i]=L[i];
         c[i]=L[i];
      }
   }
   for(int i=j-1;i>=0;--i){
      if(b[i]!=1 && c[i]!=1){
         c[i]=1;
      }
   }
   ll x=a.to_ullong();
   ll y=b.to_ullong();
   ll z=c.to_ullong();
   cout<<x<<" "<<y<<" "<<z<<endl;
}

int main(){
   std::ios::sync_with_stdio(false);
   std::cin.tie(nullptr);
   /*freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);*/
   int t;cin>>t;
   for(int i=1;i<=t;++i){
      //cout<<"Case #"<<i<<": ";
      solve();
   }
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
using namespace std;
#define mod 1000000007

ll lcm(ll a,ll b){
   return (a*b)/(__gcd(a,b));
}

ll LCM(const vector<ll> &d){
   ll result=d[0];
   for(int i=1;i<d.size();++i){
     result=lcm(result , d[i]);
   }
   return result;
}

void solve(){
   ll l,r;cin>>l>>r;
   if(r-l==2){
      cout<<l<<" "<<l+1<<" "<<r<<endl;
      return;
   }
   bitset<64> L(l),R(r),a,b,c;
   int count=0;
   int j=0;
   for(int i=63;i>=0;--i){
      if(L[i]){
         b[i]=L[i];
         c[i]=L[i];
      }
   }
   for(int i=63;i>=0;--i){
      if(R[i]){
         if(b[i]!=1 && c[i]!=1){
           a[i]=1;
           j=i;
           break;
         }
         else a[i]=1;
      }
   }
   for(int i=j-1;i>=0;--i){
      if(b[i]!=1 && c[i]!=1){
         c[i]=1;
      }
   }
   ll x=a.to_ullong();
   ll y=b.to_ullong();
   ll z=c.to_ullong();
   cout<<x<<" "<<y<<" "<<z<<endl;
}

int main(){
   std::ios::sync_with_stdio(false);
   std::cin.tie(nullptr);
   /*freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);*/
   int t;cin>>t;
   for(int i=1;i<=t;++i){
      //cout<<"Case #"<<i<<": ";
      solve();
   }
}