ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

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

int main()
{
    long long t;
    cin >> t;
    while (t--)
    {
        long long num;
        cin >> num;

        long long twos_count = 0, threes_count = 0, sum = 0;

        while (num > 0)
        {
            long long k = num % 10;
            if (k == 2)
            {
                twos_count++;
            }
            else if (k == 3)
            {
                threes_count++;
            }
            sum += k; 
            num /= 10; 
        }
        if (sum % 9 == 0)
        {
            cout << "YES" << endl;
        }
        else
        {

            if(twos_count>5)
            {
                twos_count = 5;
            }
            if(threes_count>3)
            {
                threes_count = 3;
            }
            bool marker = false;
            long long rem = sum%9;
            for(long long i =0;i<=threes_count;i++)
            {
                for(long long j=0;j<=twos_count;j++)
                {
                    if((rem+(i*6)+(j*2))%9==0)
                    {
                        marker = true;
                        break;
                    }
                }
                if(marker)
                {
                    break;
                }
            }
            if(marker)
            {
                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--)
    {
        string num;
        cin >> num;

        int twos_count = 0, threes_count = 0, sum = 0;

        // Process digits as a string to avoid overflow
        for (char digit : num)
        {
            int k = digit - '0';
            if (k == 2)
                twos_count++;
            else if (k == 3)
                threes_count++;
            sum += k;
        }

        if (sum % 9 == 0)
        {
            cout << "YES" << endl;
            continue;
        }

        // Limit effective counts based on problem constraints
        twos_count = min(twos_count, 5);
        threes_count = min(threes_count, 3);

        bool marker = false;
        int rem = sum % 9;

        for (int i = 0; i <= threes_count; i++)
        {
            for (int j = 0; j <= twos_count; j++)
            {
                if ((rem + i * 6 + j * 2) % 9 == 0)
                {
                    marker = true;
                    break;
                }
            }
            if (marker)
                break;
        }

        if (marker)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }

    return 0;
}
Problem: 2050C - Uninteresting Number
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--)
    {
        long long num;
        cin >> num;

        int twos_count = 0, threes_count = 0, sum = 0;

        while (num > 0)
        {
            int k = num % 10;
            if (k == 2)
            {
                twos_count++;
            }
            else if (k == 3)
            {
                threes_count++;
            }
            sum += k; 
            num /= 10; 
        }
        if (sum % 9 == 0)
        {
            cout << "YES" << endl;
            continue;
        }

        if(twos_count>5)
        {
            twos_count = 5;
        }
        if(threes_count>3)
        {
            threes_count = 3;
        }
        bool marker = false;
        int rem = sum%9;
        for(int i =0;i<=threes_count;i++)
        {
            for(int j=0;j<=twos_count;j++)
            {
                if((rem+(i*6)+(j*2))%9==0)
                {
                    marker = true;
                    break;
                }
            }
            if(marker)
            {
                break;
            }
        }
        if(marker)
        {
            cout<<"YES"<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
        
    }

    return 0;
}


Submission (verdict: Compilation error):
#include <bits/stdc++.h>
using namespace std;

long long main()
{
    long long t;
    cin >> t;
    while (t--)
    {
        long long num;
        cin >> num;

        long long twos_count = 0, threes_count = 0, sum = 0;

        while (num > 0)
        {
            long long k = num % 10;
            if (k == 2)
            {
                twos_count++;
            }
            else if (k == 3)
            {
                threes_count++;
            }
            sum += k; 
            num /= 10; 
        }
        if (sum % 9 == 0)
        {
            cout << "YES" << endl;
        }
        else
        {

            if(twos_count>5)
            {
                twos_count = 5;
            }
            if(threes_count>3)
            {
                threes_count = 3;
            }
            bool marker = false;
            long long rem = sum%9;
            for(long long i =0;i<=threes_count;i++)
            {
                for(long long j=0;j<=twos_count;j++)
                {
                    if((rem+(i*6)+(j*2))%9==0)
                    {
                        marker = true;
                        break;
                    }
                }
                if(marker)
                {
                    break;
                }
            }
            if(marker)
            {
                cout<<"YES"<<endl;
            }
            else
            {
                cout<<"NO"<<endl;
            }
        }
    }

    return 0;
}
Problem: 2050C - Uninteresting Number
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--)
    {
        string num;
        cin >> num;

        int twos_count = 0, threes_count = 0, sum = 0;

        // Process digits as a string to avoid overflow
        for (char digit : num)
        {
            int k = digit - '0';
            if (k == 2)
                twos_count++;
            else if (k == 3)
                threes_count++;
            sum += k;
        }

        if (sum % 9 == 0)
        {
            cout << "YES" << endl;
            continue;
        }

        // Limit effective counts based on problem constraints
        twos_count = min(twos_count, 5);
        threes_count = min(threes_count, 3);

        bool marker = false;
        int rem = sum % 9;

        for (int i = 0; i <= threes_count; i++)
        {
            for (int j = 0; j <= twos_count; j++)
            {
                if ((rem + i * 6 + j * 2) % 9 == 0)
                {
                    marker = true;
                    break;
                }
            }
            if (marker)
                break;
        }

        if (marker)
            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--)
    {
        string num;
        cin >> num;

        int twos_count = 0, threes_count = 0, sum = 0;

        // Process digits as a string to avoid overflow
        for (char digit : num)
        {
            int k = digit - '0';
            if (k == 2)
                twos_count++;
            else if (k == 3)
                threes_count++;
            sum += k;
        }

        if (sum % 9 == 0)
        {
            cout << "YES" << endl;
            continue;
        }

        // Limit effective counts based on problem constraints
        twos_count = min(twos_count, 8);
        threes_count = min(threes_count, 5);

        bool marker = false;
        int rem = sum % 9;

        for (int i = 0; i <= threes_count; i++)
        {
            for (int j = 0; j <= twos_count; j++)
            {
                if ((rem + i * 6 + j * 2) % 9 == 0)
                {
                    marker = true;
                    break;
                }
            }
            if (marker)
                break;
        }

        if (marker)
            cout << "YES" << endl;
        else
            cout << "NO" << endl;
    }

    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)


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

int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        long long num;
        cin >> num;

        int twos_count = 0, threes_count = 0, sum = 0;

        while (num > 0)
        {
            int k = num % 10;
            if (k == 2)
            {
                twos_count++;
            }
            else if (k == 3)
            {
                threes_count++;
            }
            sum += k; 
            num /= 10; 
        }
        if (sum % 9 == 0)
        {
            cout << "YES" << endl;
            continue;
        }

        if(twos_count>5)
        {
            twos_count = 5;
        }
        if(threes_count>3)
        {
            threes_count = 3;
        }
        bool marker = false;
        int rem = sum%9;
        for(int i =0;i<=threes_count;i++)
        {
            for(int j=0;j<=twos_count;j++)
            {
                if((rem+(i*6)+(j*2))%9==0)
                {
                    marker = true;
                    break;
                }
            }
            if(marker)
            {
                break;
            }
        }
        if(marker)
        {
            cout<<"YES"<<endl;
        }
        else
        {
            cout<<"NO"<<endl;
        }
        
    }

    return 0;
}
Problem: 2063C - Remove Exactly Two
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 4):
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        vector<int>vec[n+2];
        int degree[n+2]={0};
        for(int i=1;i<n;i++)
        {
            int u,v;
            cin>>u>>v;
            vec[u].push_back(v);
            vec[v].push_back(u);
            degree[u]++;
            degree[v]++;
        }
        int mx=0,node;
        for(int i=1;i<=n;i++)
        {
            if(degree[i]>=mx)
            {
                mx=degree[i];
                node=i;
            }
        }
        for(auto it: vec[node])
        {
            degree[it]--;
        }
       /// cout<<mx<<endl;
        int mx2=0;
        for(int i=1;i<=n;i++)
        {
            if(i==node) continue;
            if(degree[i]>=mx2)
            {
                mx2=degree[i];
            }
        }
        ///cout<<mx2<<endl;
        cout<<mx+mx2-1<<endl;

    }
    return 0;
}
Problem: 2063C - Remove Exactly Two
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 26):
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        vector<int>vec[n+2];
        int degree[n+2]={0};
        for(int i=1;i<n;i++)
        {
            int u,v;
            cin>>u>>v;
            vec[u].push_back(v);
            vec[v].push_back(u);
            degree[u]++;
            degree[v]++;
        }
        if(n<=5) {cout<<n-2<<endl; continue;}
        int mx=0,node;
        for(int i=1;i<=n;i++)
        {
            if(degree[i]>=mx)
            {
                mx=degree[i];
                node=i;
            }
        }
        for(auto it: vec[node])
        {
            degree[it]--;
        }
       /// cout<<mx<<endl;
        int mx2=0;
        for(int i=1;i<=n;i++)
        {
            if(i==node) continue;
            if(degree[i]>=mx2)
            {
                mx2=degree[i];
            }
        }
        ///cout<<mx2<<endl;
        cout<<mx+mx2-1<<endl;

    }
    return 0;
}


Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        vector<int>vec[n+2];
        int degree[n+2]={0};
        for(int i=1;i<n;i++)
        {
            int u,v;
            cin>>u>>v;
           // vec[u].push_back(v);
           // vec[v].push_back(u);
            degree[u]++;
            degree[v]++;
        }
        int mx=0,node=0,mx2=0;;
        for(int i=1;i<=n;i++)
        {
            if(degree[i]>=mx)
            {
                mx2=mx;
                mx=degree[i];
                node=i;
            }
            else if(degree[i]>mx2)
            {
                mx2=degree[i];
            }
        }
        cout<<min(mx+mx2-1,n-2)<<endl;

    }
    return 0;
}

/*

1
22
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 2
17 4
17 6
17 8
18 10
18 12
18 14
18 16
17 19
18 19
19 20
19 21
19 22

*/
Problem: 2063C - Remove Exactly Two
Language: C++23 (GCC 14-64, msys2)

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;
        cin>>n;
        vector<int>vec[n+2];
        int degree[n+2]={0};
        for(int i=1;i<n;i++)
        {
            int u,v;
            cin>>u>>v;
           // vec[u].push_back(v);
           // vec[v].push_back(u);
            degree[u]++;
            degree[v]++;
        }
        int mx=0,node=0,mx2=0;;
        for(int i=1;i<=n;i++)
        {
            if(degree[i]>=mx)
            {
                mx2=mx;
                mx=degree[i];
                node=i;
            }
            else if(degree[i]>mx2)
            {
                mx2=degree[i];
            }
        }
        cout<<min(mx+mx2-1,n-2)<<endl;

    }
    return 0;
}

/*

1
22
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 2
17 4
17 6
17 8
18 10
18 12
18 14
18 16
17 19
18 19
19 20
19 21
19 22

*/


Submission (verdict: Accepted):
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin >> n;
        vector<int> adj[n + 1];
        set<pair<int, int>> st;
        for (int i=1;i<n;i++)
        {
            int u, v;
            cin >> u >> v;
            adj[u].push_back(v);
            adj[v].push_back(u);
            st.insert({u, v});
            st.insert({v, u});
        }
        vector<pair<int, int>> vp;
        for (int i = 1; i <= n; i++)
        {
            vp.push_back({(int)adj[i].size(), i});
        }
        sort(vp.begin(), vp.end(), greater<pair<int, int>>());;
        int  ans = 0;
        for (int i = 0; i < 2; i++)
        {
            for (int j = i + 1; j < vp.size(); j++)
            {
                if (st.find({vp[i].second, vp[j].second}) == st.end())
                {
                    ans = max(ans, vp[i].first + vp[j].first - 1);
                }
                else
                {
                    ans = max(ans, vp[i].first + vp[j].first - 2);
                }
            }
        }
        cout << ans << endl;
    }
    return 0;
}

/*

1
22
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 2
17 4
17 6
17 8
18 10
18 12
18 14
18 16
17 19
18 19
19 20
19 21
19 22

*/
Problem: 2063C - Remove Exactly Two
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 4):
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        vector<int>vec[n+2];
        int degree[n+2]={0};
        for(int i=1;i<n;i++)
        {
            int u,v;
            cin>>u>>v;
            vec[u].push_back(v);
            vec[v].push_back(u);
            degree[u]++;
            degree[v]++;
        }
        int mx=0,node;
        for(int i=1;i<=n;i++)
        {
            if(degree[i]>=mx)
            {
                mx=degree[i];
                node=i;
            }
        }
        for(auto it: vec[node])
        {
            degree[it]--;
        }
       /// cout<<mx<<endl;
        int mx2=0;
        for(int i=1;i<=n;i++)
        {
            if(i==node) continue;
            if(degree[i]>=mx2)
            {
                mx2=degree[i];
            }
        }
        ///cout<<mx2<<endl;
        cout<<mx+mx2-1<<endl;

    }
    return 0;
}


Submission (verdict: Wrong answer on test 26):
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        vector<int>vec[n+2];
        int degree[n+2]={0};
        for(int i=1;i<n;i++)
        {
            int u,v;
            cin>>u>>v;
            vec[u].push_back(v);
            vec[v].push_back(u);
            degree[u]++;
            degree[v]++;
        }
        if(n<=5) {cout<<n-2<<endl; continue;}
        int mx=0,node;
        for(int i=1;i<=n;i++)
        {
            if(degree[i]>=mx)
            {
                mx=degree[i];
                node=i;
            }
        }
        for(auto it: vec[node])
        {
            degree[it]--;
        }
       /// cout<<mx<<endl;
        int mx2=0;
        for(int i=1;i<=n;i++)
        {
            if(i==node) continue;
            if(degree[i]>=mx2)
            {
                mx2=degree[i];
            }
        }
        ///cout<<mx2<<endl;
        cout<<mx+mx2-1<<endl;

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

Previous submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int tc=1,tc1=1;
    cin>>tc;
    up:
    while(tc--){
      ll l,r;
      cin>>l>>r;
      ll l1=l,l2=l;
      for(int i=30;i>=0;i--){
        ll val=(1LL<<i);
        if(l1+val<=r){
          l1+=val;
        }
        if(l1>l2){
          swap(l1,l2);
        }
      }
      cout<<l<<" "<<l1<<" "<<l2<<'\n';
    }
}


Submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int tc=1,tc1=1;
    cin>>tc;
    up:
    while(tc--){
      ll l,r;
      cin>>l>>r;
      vector<ll>a(3);
      for(int i=30;i>=0;i--){
        ll x=(1LL<<i);
        if(a[0]+x>r){
          continue;
        }
        if(a[2]+x-1<l){
          a[0]+=x,a[1]+=x,a[2]+=x;
          continue;
        }
        a[0]+=x;
        if(a[1]+x-1<l){
          a[1]+=x;
        }
        sort(a.begin(),a.end());
      }
      cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<'\n';
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int tc=1,tc1=1;
    cin>>tc;
    up:
    while(tc--){
      ll l,r;
      cin>>l>>r;
      vector<ll>a(3);
      for(int i=30;i>=0;i--){
        ll x=(1LL<<i);
        if(a[0]+x>r){
          continue;
        }
        if(a[2]+x-1<l){
          a[0]+=x,a[1]+=x,a[2]+=x;
          continue;
        }
        a[0]+=x;
        if(a[1]+x-1<l){
          a[1]+=x;
        }
        sort(a.begin(),a.end());
      }
      cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<'\n';
    }
}


Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int tc=1,tc1=1;
    cin>>tc;
    up:
    while(tc--){
      ll l,r;
      cin>>l>>r;
      if(r-l==2){
        cout<<l<<" "<<l+1<<" "<<r<<'\n';
        goto up;
      }
      vector<ll>a(3);
      for(int i=30;i>=0;i--){
        ll x=(1LL<<i);
        if(a[0]+x>r){
          continue;
        }
        if(a[2]+x-1<l){
          a[0]+=x,a[1]+=x,a[2]+=x;
          continue;
        }
        a[0]+=x;
        if(a[1]+x-1<l){
          a[1]+=x;
        }
        sort(a.begin(),a.end());
      }
      cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<'\n';
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int tc=1,tc1=1;
    cin>>tc;
    up:
    while(tc--){
      ll l,r;
      cin>>l>>r;
      ll l1=l,l2=l;
      for(int i=30;i>=0;i--){
        ll val=(1LL<<i);
        if(l1+val<=r){
          l1+=val;
        }
        if(l1>l2){
          swap(l1,l2);
        }
      }
      cout<<l<<" "<<l1<<" "<<l2<<'\n';
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int tc=1,tc1=1;
    cin>>tc;
    up:
    while(tc--){
      ll l,r;
      cin>>l>>r;
      if(r-l==2){
        cout<<l<<" "<<l+1<<" "<<r<<'\n';
        goto up;
      }
      vector<ll>a(3);
      for(int i=30;i>=0;i--){
        ll x=(1LL<<i);
        if(a[0]+x>r){
          continue;
        }
        if(a[2]+x-1<l){
          a[0]+=x,a[1]+=x,a[2]+=x;
          continue;
        }
        a[0]+=x;
        if(a[1]+x-1<l){
          a[1]+=x;
        }
        sort(a.begin(),a.end());
      }
      cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<'\n';
    }
}


Submission (verdict: Accepted):
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int tc=1,tc1=1;
    cin>>tc;
    up:
    while(tc--){
      ll l,r;
      cin>>l>>r;
      vector<ll>a(3);
      for(int i=30;i>=0;i--){
        ll x=(1LL<<i);
        if(a[0]+x>r){
          continue;
        }
        if(a[2]+x-1<l){
          a[0]+=x,a[1]+=x,a[2]+=x;
          continue;
        }
        a[0]+=x;
        if(a[1]+x-1<l){
          a[1]+=x;
        }
        sort(a.begin(),a.end());
      }
      if(a[0]==a[1]){
        a[1]++;
      }
      if(a[1]==a[2]){
        if(a[2]==r){
          a[1]--;
        }
        else {
          a[2]++;
        }
      }
      cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<'\n';
    }
}