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

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

using ll = long long;
using ld = long double;
using namespace std;
#define endl "\n";
#define ff first
#define ss second

void solve(){
    string s;
    cin>>s;
    int x2=0;
    int x3=0;
    int s1=0;
    for(int i=0;i<s.size();i++){
        s1+=int(s[i]-48);
        if(int(s[i]-48)==2){
            x2++;
        }
        if(int(s[i]-48)==3){
            x3++;
        }
    }
    s1=s1%9;
    s1=(9-s1);
    bool ans=false;
        if(s1==1){
            if(x2>=5){
                ans=true;
            }
        }
        if(s1==3){
            if(x2>=15||(x3>=2)){
                ans=true;
            }
        }
        if(s1==5){
            if(x2>=25||(x3>=2&&x2>=10)){
                ans=true;
            }
        }
        if(s1==7){
            if(x2>=35||(x3>=2&&x2>=20)||(x2>=1&&x2>=5)){
                ans=true;
            }
        }
        if(s1==9){
            ans=true;
        }
            if(s1==2){
                if(x2>=1){
                    ans=true;
                }
            }
            if(s1==4){
                if(x2>=2){
                    ans=true;
                }
            }
            if(s1==6){
                if(x3>=1||x2>=3){
                    ans=true;
                }
            }
            if(s1==8){
                if(x2>=4||(x3>=1&&x2>=1)){
                    ans=true;
                }
            }
        
    if(ans){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }


}

int main() {
    int T = 1;
    cin >> T;
    while(T--){
        solve();
    }
    return 0;
}


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

using ll = long long;
using ld = long double;
using namespace std;
#define endl "\n";
#define ff first
#define ss second

void solve(){
    string s;
    cin>>s;
    int x2=0;
    int x3=0;
    int s1=0;
    for(int i=0;i<s.size();i++){
        s1+=int(s[i]-48);
        if(int(s[i]-48)==2){
            x2++;
        }
        if(int(s[i]-48)==3){
            x3++;
        }
    }
    s1=s1%9;
    s1=(9-s1);
    bool ans=false;
        if(s1==1){
            if(x2>=5||(x3>=1&&x2>=2)){
                ans=true;
            }
        }
        if(s1==3){
            if(x2>=15||(x3>=2)){
                ans=true;
            }
        }
        if(s1==5){
            if(x2>=25||(x3>=2&&x2>=10)){
                ans=true;
            }
        }
        if(s1==7){
            if(x2>=35||(x3>=2&&x2>=20)||(x2>=1&&x2>=5)){
                ans=true;
            }
        }
        if(s1==9){
            ans=true;
        }
            if(s1==2){
                if(x2>=1){
                    ans=true;
                }
            }
            if(s1==4){
                if(x2>=2){
                    ans=true;
                }
            }
            if(s1==6){
                if(x3>=1||x2>=3){
                    ans=true;
                }
            }
            if(s1==8){
                if(x2>=4||(x3>=1&&x2>=1)){
                    ans=true;
                }
            }
        
    if(ans){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }


}

int main() {
    int T = 1;
    cin >> T;
    while(T--){
        solve();
    }
    return 0;
}