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

Previous submission (verdict: Wrong answer on test 2):

#include <bits/stdc++.h>
using namespace std;
#define int long long 
int32_t main()
{
    int test;
    cin>>test;
    while(test--){
       int n;
       cin>>n;
       int count2=0;
       int count3=0;
       int  sum=0;
       while(n!=0){
           if(n%10==2)count2++;
           if(n%10==3)count3++;
           sum+=n%10;
           n=n/10;
       }
       int req=9-(sum%9);
       
       if(req==3||req==6){
           if(req==3){
               if(count2>=6||count3>=2)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }else{
               if(count2>=3||count3>=6)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           
       }else{
           if(req==9){
               cout<<"yes"<<endl;
           }
           else if(req==1){
               if(count2>=5)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           else if(req==2){
               if(count2>=1)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           else if(req==4){
               if(count2>=2)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           else if(req==5){
               if(count2>=7)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           else if(req==7){
               if(count2>=5)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           else if(req==8){
               if(count2>=7)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           
       }
       
        
    }

    return 0;
}

Submission (verdict: Wrong answer on test 2):

#include <bits/stdc++.h>
using namespace std;
#define int long long 
int32_t main()
{
    int test;
    cin>>test;
    while(test--){
       int n;
       cin>>n;
       int count2=0;
       int count3=0;
       int  sum=0;
       while(n!=0){
           if(n%10==2)count2++;
           if(n%10==3)count3++;
           sum+=n%10;
           n=n/10;
       }
       int req=9-(sum%9);
       
       if(req==3||req==6){
           if(req==3){
               if(count2>=6||count3>=2)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }else{
               if(count2>=3||count3>=1)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           
       }else{
           if(req==9){
               cout<<"yes"<<endl;
           }
           else if(req==1){
               if(count2>=5)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           else if(req==2){
               if(count2>=1)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           else if(req==4){
               if(count2>=2)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           else if(req==5){
               if(count2>=7)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           else if(req==7){
               if(count2>=5)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           else if(req==8){
               if(count2>=7)cout<<"yes"<<endl;
               else cout<<"no"<<endl;
           }
           
       }
       
        
    }

    return 0;
}