Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
/* In the Name of ALLAH */
/** Minhaz Uddin
   Dept of CSE,Comilla University*/

#include<bits/stdc++.h>
#define ll long long
#define yes cout<<"YES"<<'\n';
#define no cout<<"NO"<<'\n';
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define tst int t;cin>>t;while(t--)
#define pb push_back
#define rvs reverse(v.begin(),v.end())
#define srt sort(v.begin(),v.end())

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
const ll  N = 1e7+9;

void solve()
{
string s;
cin>>s;
ll n,i,j, sum = 0, c2 = 0, c3 = 0;
for(i = 0;i<s.size();i++)
{
    sum+=s[i]-'0';
    if(s[i]=='2')c2++;
    else if(s[i]=='3')c3++;
}
if(sum%9==0)yes
else
{
    ll mod =9- (sum%9);
    //cout<<mod<<endl;
    if(mod==8)
    {
        if(c3>=1 && c2>=1)yes
        else if(c3>=0 && c2>=4)yes
        else no
    }
    else if(mod==7)
    {
        if(c2>=2 && c3>=2)yes
        else if(c3>=1 && c2>=5)yes
        else no
    }
    else if(mod==6)
    {
       if(c3>=1)yes
       else if(c2>=3) yes
        else no
    }
    else if(mod==5)
    {
        if(c3>=2 && c2>=1)yes
        else if(c3>=1 && c2>=4)yes
        else no
    }
    else if(mod==4)
    {
        if(c2>=2 )yes
        else no
    }
    else if(mod==3)
    {
        if(c3>=2)yes
        else if(c2>=6)yes
        else no
    }
    else if(mod==2)
    {
        if(c2>=1)yes
        else no
    }
    else if(mod==1)
    {
        if(c2>=2 && c3>=1)yes
        else no
    }

    else no
}
}



int main()
{
optimize();
tst{
solve();
}
return 0;
}


Submission (verdict: Wrong answer on test 3):
/* In the Name of ALLAH */
/** Minhaz Uddin
   Dept of CSE,Comilla University*/

#include<bits/stdc++.h>
#define ll long long
#define yes cout<<"YES"<<'\n';
#define no cout<<"NO"<<'\n';
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define tst int t;cin>>t;while(t--)
#define pb push_back
#define rvs reverse(v.begin(),v.end())
#define srt sort(v.begin(),v.end())

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
const ll  N = 1e7+9;

void solve()
{
string s;
cin>>s;
ll n,i,j, sum = 0, c2 = 0, c3 = 0;
for(i = 0;i<s.size();i++)
{
    sum+=s[i]-'0';
    if(s[i]=='2')c2++;
    else if(s[i]=='3')c3++;
}
if(sum%9==0)yes
else
{
    ll mod =9- (sum%9);
    //cout<<mod<<endl;
    if(mod==8)
    {
        if(c3>=1 && c2>=1)yes
        else if(c3>=0 && c2>=4)yes
        else no
    }
    else if(mod==7)
    {
        if(c2>=2 && c3>=2)yes
        else if(c3>=1 && c2>=5)yes
        else no
    }
    else if(mod==6)
    {
       if(c3>=1)yes
       else if(c2>=3) yes
        else no
    }
    else if(mod==5)
    {
        if(c3>=2 && c2>=1)yes
        else if(c3>=1 && c2>=4)yes
        else no
    }
    else if(mod==4)
    {
        if(c2>=2 )yes
        else no
    }
    else if(mod==3)
    {
        if(c3>=2)yes
        else if(c2>=6)yes
        else no
    }
    else if(mod==2)
    {
        if(c2>=1)yes
        else no
    }
    else if(mod==1)
    {
        if(c2>=2 && c3>=1)yes
        else if(c2>=5)yes
        else no
    }

    else no
}
}



int main()
{
optimize();
tst{
solve();
}
return 0;
}