Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Compilation error):
#include <bits/stdc++.h>

using namespace std;



void InOutFast() {

    ios::sync_with_stdio(false);

    cout.tie(nullptr);

    cin.tie(nullptr);

}

#define bye return 0

#define int long long

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

const int N = 2e5 + 5;



int main() {

    InOutFast();

    int t;

    cin >> t;

    while(t--) {

        string s;

        cin >> s;

        int c = 0, two = 0, three = 0;

        for(auto i : s) {

            c += (i - '0');

            two += (i == '2');

            three += (i == '3');

        }



        if(c%9 == 0)

            cout << "YES\n";

        else{

            bool ok = true;

            int need = 9 - (c%9);

            if(need == 1){

                if(two >= 5 or (three > 1 and two >= 2)){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 2){

                if(two > 0){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 4){

                if(two > 1){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 8){

                if(two > 3){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 3){

                if(three > 1 or (two >= 6)){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 5){

                if(two >= 7 or (three >= 2 and two >= 1)){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 6){

                if(three > 0 or (two > 3)){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 7){

                if(two >= 8 or (three >= 2 and two >= 2) or (three >= 1 and two >= 5)){

                    cout << "YES\n";

                    ok = false;

                }

            }

            if(ok)

                cout << "NO\n";

        }

    }

    bye;

}

Submission (verdict: Accepted):
#include <bits/stdc++.h>

using namespace std;



void InOutFast() {

    ios::sync_with_stdio(false);

    cout.tie(nullptr);

    cin.tie(nullptr);

}

#define bye return 0

#define int long long

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

const int N = 2e5 + 5;



int32_t main() {

    InOutFast();

    int t;

    cin >> t;

    while(t--) {

        string s;

        cin >> s;

        int c = 0, two = 0, three = 0;

        for(auto i : s) {

            c += (i - '0');

            two += (i == '2');

            three += (i == '3');

        }



        if(c%9 == 0)

            cout << "YES\n";

        else{

            c = c%9;

            bool ok = false;

            for(int i=0; i<= min(two, 9ll); i++){

                for(int j=0; j<= min(three, 3ll); j++){

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

                        ok = true;

                        cout << "YES\n";

                        break;

                    }

                }

                if(ok)

                    break;

            }

            if(!ok)

                cout << "NO\n";

        }

    }

    bye;

}