Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define int long long
#define Endl endl


signed main() {
    fastio;
	int t;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        int n=s.size();
        vector<short> v(n);
        int c2=0,c3=0,sum=0;
        for(int i=0;i<n;i++)
        {
            v[i]=s[i]-48;
            if(v[i]==2)c2++;
            else if(v[i]==3)c3++;
            sum+=v[i];
        } 
        int r= 9-sum%9;
        if(r==1 && c2>=2 && c3>=1)
        {
            cout<<"YES\n";
            continue;
        }
        if(r==2 && (  (c2>=1)  ))
        {
            cout<<"YES\n";
            continue;
        }
        if(r==3 && ((c3>=2) || (c3>=4 && c2>=3)))
        {
            cout<<"YES\n";
            continue;
        }
        if(r==2 || r==4 || r==6 || r==8)
        {
            if(2*c2 >= r){
                cout<<"YES\n";
            continue;}
        }
        if(r==5 &&( (c2>=7) ||(c2>=4 && c3>=1) || (c3>=2 && c2>=1)))
        {
            cout<<"YES\n";
            continue;
        }
        if(r==6 && c3>=1){
            cout<<"YES\n";
            continue;
        }
        if(r==7 && (  (c2>=8) || (c3>=1 && c2>=5) || (c3>=2 && c2>=2 )   ))
        {
            cout<<"YES\n";
            continue;
        }
        if(r==8 && (  (c2>=4) || (c3>=1 && c2>=1)  ))
        {
            cout<<"YES\n";
            continue;
        }
        if(r==0 || r==9){
            cout<<"YES\n";
            continue;
        }
        cout<<"NO\n";

        
    }
    
}




Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define int long long
#define Endl endl


signed main() {
    fastio;
	int t;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        int n=s.size();
        vector<short> v(n);
        int c2=0,c3=0,sum=0;
        for(int i=0;i<n;i++)
        {
            v[i]=s[i]-48;
            if(v[i]==2)c2++;
            else if(v[i]==3)c3++;
            sum+=v[i];
        } 
        int r= 9-sum%9;
        if(r==1 &&( (c2>=2 && c3>=1) || c2>=5))
        {
            cout<<"YES\n";
            continue;
        }
        if(r==2 && (  (c2>=1)  ))
        {
            cout<<"YES\n";
            continue;
        }
        if(r==3 && ((c3>=2) || (c3>=1 && c2>=3) || c2>=6))
        {
            cout<<"YES\n";
            continue;
        }
        if(r==2 || r==4 || r==6 || r==8)
        {
            if(2*c2 >= r){
                cout<<"YES\n";
            continue;}
        }
        if(r==5 &&( (c2>=7) ||(c2>=4 && c3>=1) || (c3>=2 && c2>=1)))
        {
            cout<<"YES\n";
            continue;
        }
        if(r==6 && c3>=1){
            cout<<"YES\n";
            continue;
        }
        if(r==7 && (  (c2>=8) || (c3>=1 && c2>=5) || (c3>=2 && c2>=2 )   ))
        {
            cout<<"YES\n";
            continue;
        }
        if(r==8 && (  (c2>=4) || (c3>=1 && c2>=1)  ))
        {
            cout<<"YES\n";
            continue;
        }
        if(r==0 || r==9){
            cout<<"YES\n";
            continue;
        }
        cout<<"NO\n";

        
    }
    
}