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

Previous submission (verdict: Wrong answer on test 1):
// Aur Bhai Dekhne aagaye ;)

// Author: Parul(OG)

#include <bits/stdc++.h>

using namespace std;

#define pi (3.141592653589)

#define mod 1000000007

#define inp(x) \

    int x;     \

    cin >> x;

#define pb push_back

#define scanarr                 \

    int arr[n];                 \

    for (int i = 0; i < n; i++) \

    cin >> arr[i]

#define pb push_back

#define is insert

#define fre(i, b) for (int i = 0; i < (int)(b); i++)

#define mp make_pair

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define min3(a, b, c) min(c, min(a, b))

#define min4(a, b, c, d) min(d, min(c, min(a, b)))

#define inpvi(n) \

    vi a(n);     \

    fr(n) { cin >> a[i]; }

#define rfr(n) for (int i = n - 1; i >= 0; i--)

#define rep1(i, a, b) for (long long i = a; i <= b; i++)

#define fr(n) for (long long i = 0; i < n; i++)

#define fr1(n) for (long long i = 1; i < n; i++)

#define nesfr(x, y)                   \

    for (long long i = 0; i < x; i++) \

        for (long long j = 0; j < y; j++)

#define rep(i, a, b) for (long long i = a; i < b; i++)

#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);

typedef long long int ll;

typedef long double ld;

typedef vector<ll> vi;

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

#define nl cout << "\n"

const unsigned int M = 1000000007;

const int N = 2e5 + 5;



void solve()

{

    string n;

    cin >> n;



    ll sum = 0;

    bool posi = false;

    for (char digi : n)

    {

        sum += digi - '0';

    }

    if (sum % 9 == 0)

    {

        posi = true;

    }

    else

    {



        for (char digit : n)

        {

            int digi = digit - '0';

            if (digi == 2 || digi == 3)

            {

                int newsum = sum + (digi * digi) - digi;

                if (newsum % 9 == 0)

                {

                    posi = true;

                    break;

                }

            }

        }

    }

    if (posi)

    {

        cout << "YES" << endl;

    }

    else

    {

        cout << "NO" << endl;

    }

}



int main()

{

    fast;

    ll t = 1;

    cin >> t;

    while (t--)

    {

        solve();

    }

    return 0;

}



Submission (verdict: Wrong answer on test 3):
// Aur Bhai Dekhne aagaye ;)

// Author: Parul(OG) 

#include <bits/stdc++.h>

using namespace std;

#define pi (3.141592653589)

#define mod 1000000007

#define inp(x)  int x;     cin >> x;

#define pb push_back

#define scanarr                int arr[n];                  for (int i = 0; i < n; i++)  cin >> arr[i]

#define pb push_back

#define is insert

#define fre(i, b) for (int i = 0; i < (int)(b); i++)

#define mp make_pair

#define ff first

#define ss second

#define all(x) x.begin(), x.end()

#define min3(a, b, c) min(c, min(a, b))

#define min4(a, b, c, d) min(d, min(c, min(a, b)))

#define inpvi(n) vi a(n);fr(n){cin>>a[i];}

#define rfr(n) for(int i=n-1;i>=0;i--)

#define rep1(i,a,b) for(long long i=a;i<=b;i++)

#define fr(n) for(long long i=0;i<n;i++)

#define fr1(n) for(long long i=1;i<n;i++)

#define nesfr(x,y) for(long long i=0;i<x;i++)for(long long j=0;j<y;j++)

#define rep(i,a,b) for(long long i=a;i<b;i++)

#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);

typedef long long int ll;

typedef long double ld;

typedef vector<ll> vi;

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

#define nl cout << "\n"

const unsigned int M = 1000000007;

const int  N = 2e5 + 5 ;





void solve() {

    ll n;

    cin>>n;

    int sum=0;

    int num3=0, num2=0;



bool found = false;

    while(n>0){

        if(n%10 == 3){

            num3++;

        }

        if(n%10 == 2){

            num2++;

        }

        sum+= n%10;

        n=n/10;

    }

   // cout<<num3<<' '<<num2<<' '<<sum<<endl;





    for (int i = 0; i < min(10, num2 + 1); i++) {

        for (int j = 0; j < min(10, num3 + 1); j++) {

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

                

            found=true;

            break;

        }

    }

}

if(found){

    cout<<"YES"<<endl;

}else{

    cout<<"NO"<<endl;

}

        

}





int main(){

fast;

ll t=1;

cin>>t;

while(t--)

{

    solve();

}

return 0;

}