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;



// Yash Raj 2112047

#define ll long long

#define ld long double

#define pb push_back

#define mp make_pair

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

#define rall(v) (v).rbegin(), (v).rend()

#define sz(x) (int)(x).size()

#define F first

#define S second

#define endl '\n'



// Fast Input/Output

void fast_io() {

    ios_base::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

}



// Debugging (for personal use during development)

#define debug(x) cerr << #x << " = "; _print(x); cerr << endl;

template <typename T> void _print(T x) { cerr << x; }

template <typename T, typename V> void _print(pair<T, V> p) { cerr << "{" << p.F << "," << p.S << "}"; }

template <typename T> void _print(vector<T> v) { cerr << "[ "; for (T i : v) { _print(i); cerr << " "; } cerr << "]"; }



int main() {

    fast_io(); // Ensures fast input/output

    

    ll t;

    cin >> t; // Multiple test cases

    while (t--) {

        

        ll n;

        cin >> n;

        ll two = 0, three = 0, sum = 0;

        

        ll temp = n;

        while (temp > 0) {

            ll digit = temp % 10;

            sum += digit;

            if (digit == 2) two++;

            if (digit == 3) three++;

            temp /= 10;

        }

        

        if (sum % 9 == 0) {

            cout << "YES" << endl;

            continue;

        }



        bool flag = false;

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

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

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

                    cout << "YES" << endl;

                    flag = true;

                    break;

                }

            }

            if (flag) break;

        }



        if (!flag) cout << "NO" << endl;



    }



    return 0;

}

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

using namespace std;



// Yash Raj 2112047

#define ll long long

#define ld long double

#define pb push_back

#define mp make_pair

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

#define rall(v) (v).rbegin(), (v).rend()

#define sz(x) (int)(x).size()

#define F first

#define S second

#define endl '\n'



// Fast Input/Output

void fast_io() {

    ios_base::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

}



// Debugging (for personal use during development)

#define debug(x) cerr << #x << " = "; _print(x); cerr << endl;

template <typename T> void _print(T x) { cerr << x; }

template <typename T, typename V> void _print(pair<T, V> p) { cerr << "{" << p.F << "," << p.S << "}"; }

template <typename T> void _print(vector<T> v) { cerr << "[ "; for (T i : v) { _print(i); cerr << " "; } cerr << "]"; }



int main() {

    fast_io(); // Ensures fast input/output

    

    ll t;

    cin >> t; // Multiple test cases

    while (t--) {

        

        ll n;

        cin >> n;

        ll two = 0, three = 0, sum = 0;

        

        ll temp = n;

        while (temp > 0) {

            ll digit = temp % 10;

            sum += digit;

            if (digit == 2) two++;

            if (digit == 3) three++;

            temp /= 10;

        }

        

        if (sum % 9 == 0) {

            cout << "YES" << endl;

            continue;

        }



        bool flag = false;

        for (ll i = 0; i < min(two+1, 10LL); i++) {

            for (ll j = 0; j < min(three+1, 10LL); j++) {

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

                    cout << "YES" << endl;

                    flag = true;

                    break;

                }

            }

            if (flag) break;

        }



        if (!flag) cout << "NO" << endl;



    }



    return 0;

}