ShaysXIA/CodeInsightBench huggingface dataset:
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>
using namespace std;
typedef long long ll;

int get(int x)
{
    int cnt = 0;
    while (x > 0)
    {
        x /= 2;
        cnt++;
    }
    return cnt;
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int x, y;
        cin >> x >> y;
        int xx = x, yy = y;
        int oo = 0;
        while (get(x) == get(y))
        {
            oo += (1 << (get(x) - 1));
            x -= (1 << (get(x) - 1));
            y -= (1 << (get(y) - 1));
        }
        if (x > y)
            swap(x, y), swap(xx, yy);

        for (int i = 0; i < get(y);i++)
        {
            if(((y>>i)&1)==0)
                oo += (1 << i);
        }

        cout << xx << " " << yy << " " << (oo <= xx ? yy - 1 : oo) << endl;
    }

    return 0;
}

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

int get(int x)
{
    int cnt = 0;
    while (x > 0)
    {
        x /= 2;
        cnt++;
    }
    return cnt;
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int x, y;
        cin >> x >> y;
        int xx = x, yy = y;
        int oo = 0;
        while (get(x) == get(y))
        {
            oo += (1 << (get(x) - 1));
            x -= (1 << (get(x) - 1));
            y -= (1 << (get(y) - 1));
        }
        if (x > y)
            swap(x, y), swap(xx, yy);
        int o1 = 0, o2 = 0;
        for (int i = 0; i < get(y);i++)
        {
            if(((y>>i)&1)==0)
                o1 += (1 << i);
        }
        for (int i = 0; i < get(y);i++)
        {
            if(((x>>i)&1)==0)
                o2 += (1 << i);
        }
        if(o1==0)
            oo += o2;
        else oo+=o1;
        if(oo==yy)
            oo--;
        if(oo==xx)
            oo++;
        cout << xx << " " << yy << " " << oo << endl;
    }

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


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

int get(int x)
{
    int cnt = 0;
    while (x > 0)
    {
        x /= 2;
        cnt++;
    }
    return cnt;
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int x, y;
        cin >> x >> y;
        int xx = x, yy = y;
        int oo = 0;
        while (get(x) == get(y))
        {
            oo += (1 << (get(x) - 1));
            x -= (1 << (get(x) - 1));
            y -= (1 << (get(y) - 1));
        }
        if (x > y)
            swap(x, y), swap(xx, yy);
        // cout << x << " " << y << endl;
        oo = oo + (1 << get(y)) + ~y;
        if (oo <= xx || oo >= yy)
            oo = oo | (y - x);
        cout << xx << " " << yy << " " << oo << endl;
    }

    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>
using namespace std;
typedef long long ll;

int get(int x)
{
    int cnt = 0;
    while (x > 0)
    {
        x /= 2;
        cnt++;
    }
    return cnt;
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int x, y;
        cin >> x >> y;
        int xx = x, yy = y;
        int oo = 0;
        while (get(x) == get(y))
        {
            oo += (1 << (get(x) - 1));
            x -= (1 << (get(x) - 1));
            y -= (1 << (get(y) - 1));
        }
        if (x > y)
            swap(x, y), swap(xx, yy);
        // cout << x << " " << y << endl;
        oo = oo + (1 << get(y)) + ~y;
        /*if (oo <= xx || oo >= yy)
            oo = oo | (y - x);*/
        cout << xx << " " << yy << " " << (oo == 0 ? yy - 1 : oo) << endl;
    }

    return 0;
}

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

int get(int x)
{
    int cnt = 0;
    while (x > 0)
    {
        x /= 2;
        cnt++;
    }
    return cnt;
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int x, y;
        cin >> x >> y;
        int xx = x, yy = y;
        int oo = 0;
        while (get(x) == get(y))
        {
            oo += (1 << (get(x) - 1));
            x -= (1 << (get(x) - 1));
            y -= (1 << (get(y) - 1));
        }
        if (x > y)
            swap(x, y), swap(xx, yy);

        for (int i = 0; i < get(y);i++)
        {
            if(((y>>i)&1)==0)
                oo += (1 << i);
        }

        cout << xx << " " << yy << " " << (oo <= xx ? yy - 1 : oo) << endl;
    }

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

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

int get(int x)
{
    int cnt = 0;
    while (x > 0)
    {
        x /= 2;
        cnt++;
    }
    return cnt;
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int x, y;
        cin >> x >> y;
        int xx = x, yy = y;
        int oo = 0;
        while (get(x) == get(y))
        {
            oo += (1 << (get(x) - 1));
            x -= (1 << (get(x) - 1));
            y -= (1 << (get(y) - 1));
        }
        if (x > y)
            swap(x, y), swap(xx, yy);
        int o1 = 0, o2 = 0;
        for (int i = 0; i < get(y);i++)
        {
            if(((y>>i)&1)==0)
                o1 += (1 << i);
        }
        for (int i = 0; i < get(y);i++)
        {
            if(((x>>i)&1)==0)
                o2 += (1 << i);
        }
        if(o1==0)
            oo += o2;
        else oo+=o1;
        if(oo==yy)
            oo--;
        if(oo==xx)
            oo++;
        cout << xx << " " << yy << " " << oo << endl;
    }

    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int get(int x)
{
    int cnt = 0;
    while (x > 0)
    {
        x /= 2;
        cnt++;
    }
    return cnt;
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int x, y;
        cin >> x >> y;
        int xx = x, yy = y;
        int oo = 0;
        while (get(x) == get(y))
        {
            oo += (1 << (get(x) - 1));
            x -= (1 << (get(x) - 1));
            y -= (1 << (get(y) - 1));
        }
        if (x > y)
            swap(x, y), swap(xx, yy);
        int o1 = 0, o2 = 0;
        for (int i = 0; i < get(y); i++)
        {
            if (((y >> i) & 1) == 0)
                o1 += (1 << i);
        }
        for (int i = 0; i < get(y); i++)
        {
            if (((x >> i) & 1) == 0)
                o2 += (1 << i);
        }
        if (o1 == 0)
            oo += o2;
        else
            oo += o1;
        if (oo == yy)
            oo--;
        if (oo == xx)
            oo++;
        if (oo < xx)
            oo += (yy - xx);
        cout << xx << " " << yy << " " << oo << endl;
    }

    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>
using namespace std;
typedef long long ll;

int get(int x)
{
    int cnt = 0;
    while (x > 0)
    {
        x /= 2;
        cnt++;
    }
    return cnt;
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int x, y;
        cin >> x >> y;
        int xx = x, yy = y;
        int oo = 0;
        while (get(x) == get(y))
        {
            oo += (1 << (get(x) - 1));
            x -= (1 << (get(x) - 1));
            y -= (1 << (get(y) - 1));
        }
        if (x > y)
            swap(x, y), swap(xx, yy);
        // cout << x << " " << y << endl;
        oo = oo + (1 << get(y)) + ~y;
        if (oo <= xx || oo >= yy)
            oo = oo | (y - x);
        cout << xx << " " << yy << " " << oo << endl;
    }

    return 0;
}

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

int get(int x)
{
    int cnt = 0;
    while (x > 0)
    {
        x /= 2;
        cnt++;
    }
    return cnt;
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        int x, y;
        cin >> x >> y;
        int xx = x, yy = y;
        int oo = 0;
        while (get(x) == get(y))
        {
            oo += (1 << (get(x) - 1));
            x -= (1 << (get(x) - 1));
            y -= (1 << (get(y) - 1));
        }
        if (x > y)
            swap(x, y), swap(xx, yy);
        // cout << x << " " << y << endl;
        oo = oo + (1 << get(y)) + ~y;
        /*if (oo <= xx || oo >= yy)
            oo = oo | (y - x);*/
        cout << xx << " " << yy << " " << (oo == 0 ? yy - 1 : oo) << endl;
    }

    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)

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

using namespace std;

int main(){
    int tc;
    cin>>tc;
    for(int _=0; _<tc; _++){
        string x;
        cin>>x;
        long long sum=0;
        int twos=0;
        int threes=0;
        for(long long i=0; i<x.length(); i++){
            int n = x[i]-48;
            sum+=n;
            if(n==2) twos++;
            if(n==3) threes++;
        }

        bool flag=false;
        for(long long twth=1, tw=1, th=1; twth<=(twos+threes); tw++, th++, twth++){
            if(sum%9==0){
                flag=true;
                break;
            } else {
                if(tw<=twos && (sum+2*tw)%9==0){
                    // cout<<"twos: "<<tw<<endl;
                    flag=true;
                    break;
                }
                if(th<=threes && (sum+6*th)%9==0){
                    // cout<<"threes: "<<th<<endl;
                    flag=true;
                    break;
                }
                if((sum+8*twth)%9==0){
                    // cout<<"twos and threes: "<<twth<<endl;
                    flag=true;
                    break;
                }
            }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <algorithm>

using namespace std;

int main(){
    int tc;
    cin>>tc;
    for(int _=0; _<tc; _++){
        string x;
        cin>>x;
        long long sum=0;
        int twos=0;
        int threes=0;
        for(long long i=0; i<x.length(); i++){
            int n = x[i]-48;
            sum+=n;
            if(n==2) twos++;
            if(n==3) threes++;
        }

        bool flag=false;
        for(long long twth=1, tw=1, th=1; twth<=(twos+threes); tw++, th++, twth++){
            if(sum%9==0 || sum==0){
                flag=true;
                break;
            } else {
                if(tw<=twos && (sum+2*tw)%9==0){
                    // cout<<"twos: "<<tw<<endl;
                    flag=true;
                    break;
                }
                if(th<=threes && (sum+6*th)%9==0){
                    // cout<<"threes: "<<th<<endl;
                    flag=true;
                    break;
                }
                if((sum+8*twth)%9==0){
                    // cout<<"twos and threes: "<<twth<<endl;
                    flag=true;
                    break;
                }
            }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <algorithm>

using namespace std;

int main(){
    int tc;
    cin>>tc;
    for(int _=0; _<tc; _++){
        string x;
        cin>>x;
        long long sum=0;
        int twos=0;
        int threes=0;
        for(long long i=0; i<x.length(); i++){
            int n = x[i]-48;
            sum+=n;
            if(n==2) twos++;
            if(n==3) threes++;
        }

        bool flag=false;
        for(long long twth=1, tw=1, th=1; twth<=(twos+threes); tw++, th++, twth++){
            if(sum%9==0){
                flag=true;
                break;
            } else {
                if(tw<=twos && (sum+2*tw)%9==0){
                    // cout<<"twos: "<<tw<<endl;
                    flag=true;
                    break;
                }
                if(th<=threes && (sum+6*th)%9==0){
                    // cout<<"threes: "<<th<<endl;
                    flag=true;
                    break;
                }
                if((sum+8*twth)%9==0){
                    // cout<<"twos and threes: "<<twth<<endl;
                    flag=true;
                    break;
                }
            }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)

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

using namespace std;

int main(){
    int tc;
    cin>>tc;
    for(int _=0; _<tc; _++){
        string x;
        cin>>x;
        long long sum=0;
        int twos=0;
        int threes=0;
        for(long long i=0; i<x.length(); i++){
            int n = x[i]-48;
            sum+=n;
            if(n==2) twos++;
            if(n==3) threes++;
        }

        bool flag=false;
        if(sum%9==0 || sum==0){
            flag=true;
        } else {
            for(long long twth=1, tw=1, th=1; twth<=(twos+threes); tw++, th++, twth++){
                if(tw<=twos && (sum+2*tw)%9==0){
                    flag=true;
                    break;
                }
                if(th<=threes && (sum+6*th)%9==0){
                    flag=true;
                    break;
                }
                if((sum+8*twth)%9==0){
                    flag=true;
                    break;
                }
            }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;

    }
    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <algorithm>

using namespace std;

int main(){
    int tc;
    cin>>tc;
    for(int _=0; _<tc; _++){
        string x;
        cin>>x;
        long long sum=0;
        int twos=0;
        int threes=0;
        for(long long i=0; i<x.length(); i++){
            int n = x[i]-48;
            sum+=n;
            if(n==2) twos++;
            if(n==3) threes++;
        }

        bool flag=false;
        if(sum%9==0 || sum==0){
            flag=true;
        } else {
            for(long long twth=1, tw=1, th=1; twth<=min(twos,threes) || tw<=twos || th<=threes; tw++, th++, twth++){
                if(tw<=twos && (sum+2*tw)%9==0){
                    // cout<<"twos: "<<tw<<endl;
                    flag=true;
                    break;
                }
                if(th<=threes && (sum+6*th)%9==0){
                    // cout<<"threes: "<<th<<endl;
                    flag=true;
                    break;
                }
                if((sum+8*twth)%9==0){
                    // cout<<"twos and threes: "<<twth<<endl;
                    flag=true;
                    break;
                }
            }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;

    }
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)

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

using namespace std;

int main(){
    int tc;
    cin>>tc;
    for(int _=0; _<tc; _++){
        string x;
        cin>>x;
        long long sum=0;
        int twos=0;
        int threes=0;
        for(long long i=0; i<x.length(); i++){
            int n = x[i]-48;
            sum+=n;
            if(n==2) twos++;
            if(n==3) threes++;
        }

        bool flag=false;
        if(sum%9==0 || sum==0){
            flag=true;
        } else {
            for(long long twth=1, tw=1, th=1; twth<=min(twos,threes) || tw<=twos || th<=threes; tw++, th++, twth++){
                if(tw<=twos && (sum+2*tw)%9==0){
                    // cout<<"twos: "<<tw<<endl;
                    flag=true;
                    break;
                }
                if(th<=threes && (sum+6*th)%9==0){
                    // cout<<"threes: "<<th<<endl;
                    flag=true;
                    break;
                }
                if((sum+8*twth)%9==0){
                    // cout<<"twos and threes: "<<twth<<endl;
                    flag=true;
                    break;
                }
            }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;

    }
    return 0;
}

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

using namespace std;

int main(){
    int tc;
    cin>>tc;
    for(int _=0; _<tc; _++){
        string x;
        cin>>x;
        long long sum=0;
        int twos=0;
        int threes=0;
        for(long long i=0; i<x.length(); i++){
            int n = x[i]-48;
            sum+=n;
            if(n==2) twos++;
            if(n==3) threes++;
        }

        bool flag=false;
        if(sum%9==0 || sum==0){
            flag=true;
        } else {
            for(long long tw=0; tw<=twos; tw++){
                for(long long th=0; th<=threes; th++){
                    if((sum+2*tw+6*th)%9==0){
                        // cout<<"twos: "<<tw<<endl;
                        flag=true;
                        break;
                    }
                }
            }
            // if(!flag){
            //     for(long long th=0; th<=threes; th++){
            //         if((sum+6*th)%9==0){
            //             // cout<<"threes: "<<th<<endl;
            //             flag=true;
            //             break;
            //         }
            //     }
            // }
            // if(!flag){
            //     for(long long twth=1; twth<=min(twos,threes);twth++){
            //         if((sum+8*twth)%9==0){
            //             // cout<<"twos and threes: "<<twth<<endl;
            //             flag=true;
            //             break;
            //         }
            //     }                
            // }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;

    }
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)

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

using namespace std;

int main(){
    int tc;
    cin>>tc;
    for(int _=0; _<tc; _++){
        string x;
        cin>>x;
        long long sum=0;
        int twos=0;
        int threes=0;
        for(long long i=0; i<x.length(); i++){
            int n = x[i]-48;
            sum+=n;
            if(n==2) twos++;
            if(n==3) threes++;
        }

        bool flag=false;
        for(long long twth=1, tw=1, th=1; twth<=(twos+threes); tw++, th++, twth++){
            if(sum%9==0 || sum==0){
                flag=true;
                break;
            } else {
                if(tw<=twos && (sum+2*tw)%9==0){
                    // cout<<"twos: "<<tw<<endl;
                    flag=true;
                    break;
                }
                if(th<=threes && (sum+6*th)%9==0){
                    // cout<<"threes: "<<th<<endl;
                    flag=true;
                    break;
                }
                if((sum+8*twth)%9==0){
                    // cout<<"twos and threes: "<<twth<<endl;
                    flag=true;
                    break;
                }
            }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <algorithm>

using namespace std;

int main(){
    int tc;
    cin>>tc;
    for(int _=0; _<tc; _++){
        string x;
        cin>>x;
        long long sum=0;
        int twos=0;
        int threes=0;
        for(long long i=0; i<x.length(); i++){
            int n = x[i]-48;
            sum+=n;
            if(n==2) twos++;
            if(n==3) threes++;
        }

        bool flag=false;
        if(sum%9==0 || sum==0){
            flag=true;
        } else {
            for(long long twth=1, tw=1, th=1; twth<=(twos+threes); tw++, th++, twth++){
                if(tw<=twos && (sum+2*tw)%9==0){
                    flag=true;
                    break;
                }
                if(th<=threes && (sum+6*th)%9==0){
                    flag=true;
                    break;
                }
                if((sum+8*twth)%9==0){
                    flag=true;
                    break;
                }
            }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;

    }
    return 0;
}
Problem: 2050D - Digital string maximization
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Time limit exceeded on test 2):
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <algorithm>
#include <set>
#include <map>

using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()


int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int tc;
    cin>>tc;
    for(int _=0; _<tc; _++){
        string s,test;
        cin>>s;
        test=s;
        bool flag = true;
        while(flag){
            for(int i=1; i<s.length(); i++){
                if(s[i]>(s[i-1]+1) && s[i]!='0'){
                    char temp = s[i-1];
                    s[i-1]=s[i]-1;
                    s[i]=temp;
                    break;
                }
                if(i==(s.length()-1)){
                    flag=false;
                }
            }
            // cout<<"string: "<<s<<endl;
        }
        cout<<s<<endl;
    }
    return 0;
}