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

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

using namespace std;



typedef long long ll;

typedef vector<ll> vi;

typedef vector<vi> vvi;

typedef vector<char> vc;

typedef vector<vc> vvc;

typedef vector<pair<ll,ll>> vii;

typedef pair<ll,ll> ii;



#define M 1000000007

#define pb push_back

const ll N = 1e5;



#define f(i, a, b) for (ll i = a; i < b; i++)

#define lb(a,b) lower_bound(a.begin(),a.end(),b)

#define ub(a,b) upper_bound(a.begin(),a.end(),b)



// Binary Exponentiation Function

ll be(ll a, ll b, ll m) {

    ll ans = 1;

    while (b > 0) {

        if (b & 1) {

            ans = (ans * 1LL * a) % m;

        }

        a = (a * 1LL * a) % m;

        b >>= 1;

    }

    return ans;

}



int main() {

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    ll t;

    cin >> t;

    f(i, 0, t) {

        // Put all effort in your logic

        ll n;

        cin>>n;

        vi ans;

        while(n>0){

            ll rem=n%10;

            ans.pb(rem);

            n=n/10;

        }

        reverse(ans.begin(),ans.end());

        ll s=0;

        ll to=0,th=0;

        f(i,0,ans.size()){

           s+=ans[i];

           if(ans[i]==2) to++;

           else if(ans[i]==3) th++;

        }

        bool cond=true;

        for(ll i=0;i<=to;i++){

            for(ll j=0;j<=th;j++){

                if((s+(i*2)+(j*6))%9==0){

                    cond=false;

                    break;

                }

            }

        }

        if(!cond) cout<<"YES"<<endl;

        else{

            cout<<"NO"<<endl;

        }

    }

}

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

using namespace std;



typedef long long ll;

typedef vector<ll> vi;

typedef vector<vi> vvi;

typedef vector<char> vc;

typedef vector<vc> vvc;

typedef vector<pair<ll,ll>> vii;

typedef pair<ll,ll> ii;



#define M 1000000007

#define pb push_back

const ll N = 1e5;



#define f(i, a, b) for (ll i = a; i < b; i++)

#define lb(a,b) lower_bound(a.begin(),a.end(),b)

#define ub(a,b) upper_bound(a.begin(),a.end(),b)



// Binary Exponentiation Function

ll be(ll a, ll b, ll m) {

    ll ans = 1;

    while (b > 0) {

        if (b & 1) {

            ans = (ans * 1LL * a) % m;

        }

        a = (a * 1LL * a) % m;

        b >>= 1;

    }

    return ans;

}



int main() {

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    ll t;

    cin >> t;

    f(i, 0, t) {

        // Put all effort in your logic

        ll n;

        cin>>n;

        vi ans;

        while(n>0){

            ll rem=n%10;

            ans.pb(rem);

            n=n/10;

        }

        reverse(ans.begin(),ans.end());

        ll s=0;

        ll to=0,th=0;

        f(i,0,ans.size()){

           s+=ans[i];

           if(ans[i]==2) to++;

           else if(ans[i]==3) th++;

        }

        bool cond=true;

        for(ll i=0;i<=min((ll)10,to);i++){

            for(ll j=0;j<=min(th,ll(10));j++){

                if((s+(i*2)+(j*6))%9==0){

                    cond=false;

                    break;

                }

            }

        }

        if(!cond) cout<<"YES"<<endl;

        else{

            cout<<"NO"<<endl;

        }

    }

}