Problem: 2050C - Uninteresting Number
Language: c++20 

Code 1:
// Problem: C. Uninteresting Number
// Contest: Codeforces - Codeforces Round 991 (Div. 3)
// URL: https://codeforces.com/problemset/problem/2050/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;
 
#define fastio()                      \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)
#define int long long
#define ld long double
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define umap unordered_map
#define mii map<int, int>
#define pii pair<int, int>
#define vi vector<int>
#define vb vector<bool>
#define vvi vector<vi>
#define vpii vector<pii>
#define ff first
#define ss second
#define rep(i,x,y) for(int i=x; i<y; i++)
#define rrep(i,x,y) for(int i=x; i>=y; i--)
#define yn(f) f?cout<<"YES\n":cout<<"NO\n"
#define syn(f) f?cout<<"Yes\n":cout<<"No\n"
#define print(x) for(auto l:x) cout<<l<<" ";cout<<'\n';

int binexp(int a, int b,int M) {
    if(b==0) return 1;
    int res=binexp(a,b/2,M);
    if(b%2==1) return (((res*res)%M)*(a%M))%M;
    else return (res*res)%M;
}
 
int M = 1e9 + 7;
// int M = 998244353;

void solve(){
    int twos = 0;
    int threes = 0;
    string n;
    cin >> n;
    int sum = 0;
    rep(i, 0, n.length()){
    	char t = n[i];
    	if(t == '2'){
    		twos++;
		}
		if(t == '3'){
			threes++;
		}
		
		sum += (int)t - 48;
    }
	
	int k = sum % 9;
	
	if(k==0){
		cout << "YES" << endl;
		return;
	}
	
	rep(i, 0, twos+1){
		rep(j, 0, threes+1){
			if((k + 2*i + 6*j)%9 == 0){
				cout << "YES " << endl;
				return;
			}
		}
	}
	
	cout << "NO" << endl;
	
}
 
int32_t main(){
    fastio();
    int t = 1;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Code 2:
// Problem: C. Uninteresting Number
// Contest: Codeforces - Codeforces Round 991 (Div. 3)
// URL: https://codeforces.com/problemset/problem/2050/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;
 
#define fastio()                      \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)
#define int long long
#define ld long double
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define umap unordered_map
#define mii map<int, int>
#define pii pair<int, int>
#define vi vector<int>
#define vb vector<bool>
#define vvi vector<vi>
#define vpii vector<pii>
#define ff first
#define ss second
#define rep(i,x,y) for(int i=x; i<y; i++)
#define rrep(i,x,y) for(int i=x; i>=y; i--)
#define yn(f) f?cout<<"YES\n":cout<<"NO\n"
#define syn(f) f?cout<<"Yes\n":cout<<"No\n"
#define print(x) for(auto l:x) cout<<l<<" ";cout<<'\n';

int binexp(int a, int b,int M) {
    if(b==0) return 1;
    int res=binexp(a,b/2,M);
    if(b%2==1) return (((res*res)%M)*(a%M))%M;
    else return (res*res)%M;
}
 
int M = 1e9 + 7;
// int M = 998244353;

void solve(){
    int twos = 0;
    int threes = 0;
    int n;
    cin >> n;
    int sum = 0;
    while(n>0){
    	int t = n % 10;
    	if(t == 2){
    		twos++;
		}
		if(t == 3){
			threes++;
		}
		sum += t;
		n/=10;
    }
	
	int k = sum % 9;
	
	if(k==0){
		cout << "YES" << endl;
		return;
	}
	
	rep(i, 0, twos+1){
		rep(j, 0, threes+1){
			if((k + 2*i + 6*j)%9 == 0){
				cout << "YES " << endl;
				return;
			}
		}
	}
	
	cout << "NO" << endl;
	
}
 
int32_t main(){
    fastio();
    int t = 1;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Answer: 1