ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2060D - Subtract Min Sort
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
// February 6

#include <bits/stdc++.h>
using namespace std;

#define ll long long

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t;
    cin >> t;

    while (t--) {
        int n;
        cin >> n;
        vector<int> a(n);
        for(int i=0;i<n;i++) {
            cin >> a[i];
        }

        int flag = 1;
        for(int i=0;i<n-2;i++) {
            if(a[i] >= a[i+1] && a[i+1] >= a[i+2]) {
                flag = 0;
                cout << "NO" << endl;
                break;
            }
        }

        if(flag) {
            cout << "YES" << endl;
        }
    }
    return 0;
}


Submission (verdict: Wrong answer on test 2):
// February 6

#include <bits/stdc++.h>
using namespace std;

#define ll long long

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t;
    cin >> t;

    while (t--) {
        int n;
        cin >> n;
        vector<int> a(n);
        for(int i=0;i<n;i++) {
            cin >> a[i];
        }
        
        if(n == 1) {
          cout << "YES" << endl;
          continue;
        }
        
        if(n == 2) {
          cout << ((a[0]<=a[1])?"YES":"NO") << endl;
          continue;
        }
        
        int flag = 1;
        for(int i=0;i<n-2;i++) {
            if(a[i] >= a[i+1] && a[i+1] >= a[i+2]) {
                flag = 0;
                cout << "NO" << endl;
                break;
            }
        }

        if(flag) {
            cout << "YES" << endl;
        }
    }
    return 0;
}
Problem: 2049B - pspspsps
Language: C++17 (GCC 7-32)

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

// using namespace std;



// int main(){

//     int t;

//     cin>>t;

//     while (t--){

//         int n;

//         cin>>n;

//         vector<int> v;

//         map<int,int> mp;

//         int x,y;

//         for(int i = 0;i<n;i++){

//             cin>>x>>y;

//             mp[x] = y;

//             v.push_back(y);

//         }

//         sort(v.begin(),v.end());

//         long total = 0;

//         for(auto &j : mp){

//             auto p = lower_bound(v.begin(),v.end(),j.second);

//             total+=p-v.begin();

//             v.erase(p);

//         }

//         cout<<total<<endl;

//     }

//     return 0;

// }



#include <bits/stdc++.h>

using namespace std;

 

int main(){

	int t;

	cin>>t;

	while (t--)

	{

		int n;

		string s;

		cin>>n>>s;

		bool is_poss=true,is_p=false,is_s=false;

		if (s[0]=='s') s[0]=='.';

		if (s[n-1]=='p') s[n-1]=='.';

		for(int i = 0;i<n-1;i++){

			if(s[i]=='p') is_p = true;

			if(s[i]=='s') is_s = true;

		}

		if(is_s && is_p){

			cout<<"NO"<<endl;

		}else{

			cout<<"YES"<<endl;

		}

	}

}

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

// using namespace std;



// int main(){

//     int t;

//     cin>>t;

//     while (t--){

//         int n;

//         cin>>n;

//         vector<int> v;

//         map<int,int> mp;

//         int x,y;

//         for(int i = 0;i<n;i++){

//             cin>>x>>y;

//             mp[x] = y;

//             v.push_back(y);

//         }

//         sort(v.begin(),v.end());

//         long total = 0;

//         for(auto &j : mp){

//             auto p = lower_bound(v.begin(),v.end(),j.second);

//             total+=p-v.begin();

//             v.erase(p);

//         }

//         cout<<total<<endl;

//     }

//     return 0;

// }



#include <bits/stdc++.h>

using namespace std;

 

int main(){

	int t;

	cin>>t;

	while (t--)

	{

		int n;

		string s;

		cin>>n>>s;

		bool is_poss=true,is_p=false,is_s=false;

		if (s[0]=='s') s[0]=='.';

		if (s[n-1]=='p') s[n-1]=='.';

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

			if(s[i]=='p') is_p = true;

			if(s[i]=='s') is_s = true;

		}

		if(is_s && is_p){

			cout<<"NO"<<endl;

		}else{

			cout<<"YES"<<endl;

		}

	}

}
Problem: 2049B - pspspsps
Language: C++17 (GCC 7-32)

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

// using namespace std;



// int main(){

//     int t;

//     cin>>t;

//     while (t--){

//         int n;

//         cin>>n;

//         vector<int> v;

//         map<int,int> mp;

//         int x,y;

//         for(int i = 0;i<n;i++){

//             cin>>x>>y;

//             mp[x] = y;

//             v.push_back(y);

//         }

//         sort(v.begin(),v.end());

//         long total = 0;

//         for(auto &j : mp){

//             auto p = lower_bound(v.begin(),v.end(),j.second);

//             total+=p-v.begin();

//             v.erase(p);

//         }

//         cout<<total<<endl;

//     }

//     return 0;

// }



#include <bits/stdc++.h>

using namespace std;

 

int main(){

	int t;

	cin>>t;

	while (t--)

	{

		int n;

		string s;

		cin>>n>>s;

		bool is_poss=true,is_p=false,is_s=false;

		if (s[0]=='s') s[0]=='.';

		if (s[n-1]=='p') s[n-1]=='.';

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

			if(s[i]=='p') is_p = true;

			if(s[i]=='s') is_s = true;

		}

		if(is_s && is_p){

			cout<<"NO"<<endl;

		}else{

			cout<<"YES"<<endl;

		}

	}

}

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

// using namespace std;



// int main(){

//     int t;

//     cin>>t;

//     while (t--){

//         int n;

//         cin>>n;

//         vector<int> v;

//         map<int,int> mp;

//         int x,y;

//         for(int i = 0;i<n;i++){

//             cin>>x>>y;

//             mp[x] = y;

//             v.push_back(y);

//         }

//         sort(v.begin(),v.end());

//         long total = 0;

//         for(auto &j : mp){

//             auto p = lower_bound(v.begin(),v.end(),j.second);

//             total+=p-v.begin();

//             v.erase(p);

//         }

//         cout<<total<<endl;

//     }

//     return 0;

// }



#include <bits/stdc++.h>

using namespace std;

 

int main(){

	int t;

	cin>>t;

	while (t--)

	{

		int n;

		string s;

		cin>>n>>s;

		bool is_poss=true,is_p=false,is_s=false;

		if (s[0]=='s') s[0]='.';

		if (s[n-1]=='p') s[n-1]='.';

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

			if(s[i]=='p') is_p = true;

			if(s[i]=='s') is_s = true;

		}

		if(is_s && is_p == true){

			cout<<"NO"<<endl;

		}else{

			cout<<"YES"<<endl;

		}

	}

}
Problem: 2049B - pspspsps
Language: C++17 (GCC 7-32)

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

// using namespace std;



// int main(){

//     int t;

//     cin>>t;

//     while (t--){

//         int n;

//         cin>>n;

//         vector<int> v;

//         map<int,int> mp;

//         int x,y;

//         for(int i = 0;i<n;i++){

//             cin>>x>>y;

//             mp[x] = y;

//             v.push_back(y);

//         }

//         sort(v.begin(),v.end());

//         long total = 0;

//         for(auto &j : mp){

//             auto p = lower_bound(v.begin(),v.end(),j.second);

//             total+=p-v.begin();

//             v.erase(p);

//         }

//         cout<<total<<endl;

//     }

//     return 0;

// }



#include <bits/stdc++.h>

using namespace std;

 

int main(){

	int t;

	cin>>t;

	while (t--)

	{

		int n;

		string s;

		cin>>n>>s;

		bool is_poss=true,is_p=false,is_s=false;

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

			if(i!=0 && i!=n-1  && ((s[i]=='p' && s[n-i-1]=='s') || (s[i]=='s' && s[n-i-1]=='p'))){

				is_poss = false;

			}

			if(s[i]=='p'){

				is_p = true;

			}

			if(s[i]=='s'){

				is_s = true;

				if(is_p){

					is_poss = false;

				}

			}

		}

		if(!is_poss){

			cout<<"NO"<<endl;

		}else{

			cout<<"YES"<<endl;

		}

	}

}

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

// using namespace std;



// int main(){

//     int t;

//     cin>>t;

//     while (t--){

//         int n;

//         cin>>n;

//         vector<int> v;

//         map<int,int> mp;

//         int x,y;

//         for(int i = 0;i<n;i++){

//             cin>>x>>y;

//             mp[x] = y;

//             v.push_back(y);

//         }

//         sort(v.begin(),v.end());

//         long total = 0;

//         for(auto &j : mp){

//             auto p = lower_bound(v.begin(),v.end(),j.second);

//             total+=p-v.begin();

//             v.erase(p);

//         }

//         cout<<total<<endl;

//     }

//     return 0;

// }



#include <bits/stdc++.h>

using namespace std;

 

int main(){

	int t;

	cin>>t;

	while (t--)

	{

		int n;

		string s;

		cin>>n>>s;

		bool is_poss=true,is_p=false,is_s=false;

		if (s[0]=='s') s[0]=='.';

		if (s[n-1]=='p') s[n-1]=='.';

		for(int i = 0;i<n-1;i++){

			if(s[i]=='p') is_p = true;

			if(s[i]=='s') is_s = true;

		}

		if(is_s && is_p){

			cout<<"NO"<<endl;

		}else{

			cout<<"YES"<<endl;

		}

	}

}
Problem: 2049B - pspspsps
Language: C++17 (GCC 7-32)


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

// using namespace std;



// int main(){

//     int t;

//     cin>>t;

//     while (t--){

//         int n;

//         cin>>n;

//         vector<int> v;

//         map<int,int> mp;

//         int x,y;

//         for(int i = 0;i<n;i++){

//             cin>>x>>y;

//             mp[x] = y;

//             v.push_back(y);

//         }

//         sort(v.begin(),v.end());

//         long total = 0;

//         for(auto &j : mp){

//             auto p = lower_bound(v.begin(),v.end(),j.second);

//             total+=p-v.begin();

//             v.erase(p);

//         }

//         cout<<total<<endl;

//     }

//     return 0;

// }



#include <bits/stdc++.h>

using namespace std;

 

int main(){

	int t;

	cin>>t;

	while (t--)

	{

		int n;

		string s;

		cin>>n>>s;

		bool is_poss=true,is_p=false,is_s=false;

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

			if(i!=0 && i!=n-1  && ((s[i]=='p' && s[n-i-1]=='s') || (s[i]=='s' && s[n-i-1]=='p'))){

				is_poss = false;

			}

			if(s[i]=='p'){

				is_p = true;

			}

			if(s[i]=='s'){

				is_s = true;

				if(is_p){

					is_poss = false;

				}

			}

		}

		if(!is_poss){

			cout<<"NO"<<endl;

		}else{

			cout<<"YES"<<endl;

		}

	}

}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):

/*
 * Author  : akshyatshah
 * Created : 05/02/2025 15:32:02 
 */

#include <bits/stdc++.h>
using namespace std;

/* Aliases */
#define	ll		long long
#define	ull		unsigned long long
#define	vi		vector<int>
#define	pi		pair<int, int>
#define	pb		push_back

/* Values */
#define	MOD		998'244'353

/* Macros */
#define	odd(x)		((x) & 1)
#define	even(x)		(!((x) & 1))
#define	pw2(x)		(1 << (x))
#define	times(i,n)	for (int i=0; i<n; i++)

#define	quit(x)		{ cout << x << endl; return; }

/* Overloads */
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    for (int i = 0; i < v.size(); i++) os << v[i] << ' '; return os;
}
template <typename T> ostream& operator<<(ostream& os, const pair<T, T>& v) {
    os << v.first << ' ' << v.second; return os;
}

// ----------------------------- //
//            SOLUTION           //
// ----------------------------- //


void task(int task_number) {
    int n;
    cin>>n;
    vector<ll>a(n);
    times(i,n) cin>>a[i];

    if(n==1) quit(a[0]);

    ll sum = accumulate(a.begin(),a.end(),0LL);

    while(a.size()!= 1){
        vector<ll>result;
        for(int i=1;i<a.size();i++){
            result.push_back(a[i-1]-a[i]);
        }
        a = result;
    }
    quit(max(sum,abs(a[0])));
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t;
    times (i, t) task(i);
    return 0;
}

Submission (verdict: Wrong answer on test 2):

/*
 * Author  : akshyatshah
 * Created : 05/02/2025 15:32:02 
 */

#include <bits/stdc++.h>
using namespace std;

/* Aliases */
#define	ll		long long
#define	ull		unsigned long long
#define	vi		vector<int>
#define	pi		pair<int, int>
#define	pb		push_back

/* Values */
#define	MOD		998'244'353

/* Macros */
#define	odd(x)		((x) & 1)
#define	even(x)		(!((x) & 1))
#define	pw2(x)		(1 << (x))
#define	times(i,n)	for (int i=0; i<n; i++)

#define	quit(x)		{ cout << x << endl; return; }

/* Overloads */
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    for (int i = 0; i < v.size(); i++) os << v[i] << ' '; return os;
}
template <typename T> ostream& operator<<(ostream& os, const pair<T, T>& v) {
    os << v.first << ' ' << v.second; return os;
}

// ----------------------------- //
//            SOLUTION           //
// ----------------------------- //


void task(int task_number) {
    int n;
    cin>>n;
    vector<ll>a(n);
    times(i,n) cin>>a[i];

    if(n==1) quit(a[0]);

    ll val = 0;
    for(int i=0;i<n;i++){
        val+=abs(a[i]);
    }

    ll sum = accumulate(a.begin(),a.end(),0LL);

    sum = max(val,sum);

    while(a.size()!= 1){
        vector<ll>result;
        for(int i=1;i<a.size();i++){
            result.push_back(a[i-1]-a[i]);
        }
        a = result;
    }
    quit(max(sum,abs(a[0])));
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t;
    times (i, t) task(i);
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):

/*
 * Author  : akshyatshah
 * Created : 05/02/2025 15:32:02 
 */

#include <bits/stdc++.h>
using namespace std;

/* Aliases */
#define	ll		long long
#define	ull		unsigned long long
#define	vi		vector<int>
#define	pi		pair<int, int>
#define	pb		push_back

/* Values */
#define	MOD		998'244'353

/* Macros */
#define	odd(x)		((x) & 1)
#define	even(x)		(!((x) & 1))
#define	pw2(x)		(1 << (x))
#define	times(i,n)	for (int i=0; i<n; i++)

#define	quit(x)		{ cout << x << endl; return; }

/* Overloads */
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    for (int i = 0; i < v.size(); i++) os << v[i] << ' '; return os;
}
template <typename T> ostream& operator<<(ostream& os, const pair<T, T>& v) {
    os << v.first << ' ' << v.second; return os;
}

// ----------------------------- //
//            SOLUTION           //
// ----------------------------- //


void task(int task_number) {
    int n;
    cin>>n;
    vector<int>a(n);
    times(i,n) cin>>a[i];

    if(n==1) quit(a[0]);

    int sum = accumulate(a.begin(),a.end(),0LL);

    while(a.size()!= 1){
        vector<int>result;
        for(int i=1;i<a.size();i++){
            result.push_back(a[i-1]-a[i]);
        }
        a = result;
    }
    quit(max(sum,abs(a[0])));
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t;
    times (i, t) task(i);
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):

/*
 * Author  : akshyatshah
 * Created : 05/02/2025 15:32:02 
 */

#include <bits/stdc++.h>
using namespace std;

/* Aliases */
#define	ll		long long
#define	ull		unsigned long long
#define	vi		vector<int>
#define	pi		pair<int, int>
#define	pb		push_back

/* Values */
#define	MOD		998'244'353

/* Macros */
#define	odd(x)		((x) & 1)
#define	even(x)		(!((x) & 1))
#define	pw2(x)		(1 << (x))
#define	times(i,n)	for (int i=0; i<n; i++)

#define	quit(x)		{ cout << x << endl; return; }

/* Overloads */
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    for (int i = 0; i < v.size(); i++) os << v[i] << ' '; return os;
}
template <typename T> ostream& operator<<(ostream& os, const pair<T, T>& v) {
    os << v.first << ' ' << v.second; return os;
}

// ----------------------------- //
//            SOLUTION           //
// ----------------------------- //


void task(int task_number) {
    int n;
    cin>>n;
    vector<int>a(n);
    times(i,n) cin>>a[i];

    if(n==1) quit(a[0]);

    int sum = accumulate(a.begin(),a.end(),0LL);

    while(a.size()!= 1){
        vector<int>result;
        for(int i=1;i<a.size();i++){
            result.push_back(a[i-1]-a[i]);
        }
        a = result;
    }
    quit(max(sum,abs(a[0])));
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t;
    times (i, t) task(i);
    return 0;
}

Submission (verdict: Wrong answer on test 2):

/*
 * Author  : akshyatshah
 * Created : 05/02/2025 15:32:02 
 */

#include <bits/stdc++.h>
using namespace std;

/* Aliases */
#define	ll		long long
#define	ull		unsigned long long
#define	vi		vector<int>
#define	pi		pair<int, int>
#define	pb		push_back

/* Values */
#define	MOD		998'244'353

/* Macros */
#define	odd(x)		((x) & 1)
#define	even(x)		(!((x) & 1))
#define	pw2(x)		(1 << (x))
#define	times(i,n)	for (int i=0; i<n; i++)

#define	quit(x)		{ cout << x << endl; return; }

/* Overloads */
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    for (int i = 0; i < v.size(); i++) os << v[i] << ' '; return os;
}
template <typename T> ostream& operator<<(ostream& os, const pair<T, T>& v) {
    os << v.first << ' ' << v.second; return os;
}

// ----------------------------- //
//            SOLUTION           //
// ----------------------------- //


void task(int task_number) {
    int n;
    cin>>n;
    vector<ll>a(n);
    times(i,n) cin>>a[i];

    if(n==1) quit(a[0]);

    ll sum = accumulate(a.begin(),a.end(),0LL);

    while(a.size()!= 1){
        vector<ll>result;
        for(int i=1;i<a.size();i++){
            result.push_back(a[i-1]-a[i]);
        }
        a = result;
    }
    quit(max(sum,abs(a[0])));
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t;
    times (i, t) task(i);
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):

/*
 * Author  : akshyatshah
 * Created : 05/02/2025 15:32:02 
 */

#include <bits/stdc++.h>
using namespace std;

/* Aliases */
#define	ll		long long
#define	ull		unsigned long long
#define	vi		vector<int>
#define	pi		pair<int, int>
#define	pb		push_back

/* Values */
#define	MOD		998'244'353

/* Macros */
#define	odd(x)		((x) & 1)
#define	even(x)		(!((x) & 1))
#define	pw2(x)		(1 << (x))
#define	times(i,n)	for (int i=0; i<n; i++)

#define	quit(x)		{ cout << x << endl; return; }

/* Overloads */
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    for (int i = 0; i < v.size(); i++) os << v[i] << ' '; return os;
}
template <typename T> ostream& operator<<(ostream& os, const pair<T, T>& v) {
    os << v.first << ' ' << v.second; return os;
}

// ----------------------------- //
//            SOLUTION           //
// ----------------------------- //


void task(int task_number) {
    int n;
    cin>>n;
    vector<ll>a(n);
    times(i,n) cin>>a[i];

    if(n==1) quit(a[0]);

    ll val = 0;
    for(int i=0;i<n;i++){
        val+=abs(a[i]);
    }

    ll sum = accumulate(a.begin(),a.end(),0LL);

    sum = max(val,sum);

    while(a.size()!= 1){
        vector<ll>result;
        for(int i=1;i<a.size();i++){
            result.push_back(a[i-1]-a[i]);
        }
        a = result;
    }
    quit(max(sum,abs(a[0])));
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t;
    times (i, t) task(i);
    return 0;
}

Submission (verdict: Accepted):

/*
 * Author  : akshyatshah
 * Created : 05/02/2025 15:32:02 
 */

#include <bits/stdc++.h>
using namespace std;

/* Aliases */
#define	ll		long long
#define	ull		unsigned long long
#define	vi		vector<int>
#define	pi		pair<int, int>
#define	pb		push_back

/* Values */
#define	MOD		998'244'353

/* Macros */
#define	odd(x)		((x) & 1)
#define	even(x)		(!((x) & 1))
#define	pw2(x)		(1 << (x))
#define	times(i,n)	for (int i=0; i<n; i++)

#define	quit(x)		{ cout << x << endl; return; }

/* Overloads */
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    for (int i = 0; i < v.size(); i++) os << v[i] << ' '; return os;
}
template <typename T> ostream& operator<<(ostream& os, const pair<T, T>& v) {
    os << v.first << ' ' << v.second; return os;
}

// ----------------------------- //
//            SOLUTION           //
// ----------------------------- //


void task(int task_number) {
    int n;
    cin>>n;
    vector<ll>a(n);
    times(i,n) cin>>a[i];

    if(n==1) quit(a[0]);
    ll ans = INT_MIN;
    int num = n ;
    for(int i=0;i<n;i++){
        ll sum = 0;
        for(int i=0;i<num;i++){
            sum+=a[i];
        }
        if(i==0) ans = max(ans,sum);
        else ans = max(ans,max(sum,(- sum)));
        for(int i=0;i<n-1;i++){
            a[i] = a[i+1]-a[i];
        }
        num--;
    }
    quit(ans);
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int t; cin >> t;
    times (i, t) task(i);
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)


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

using namespace std;
void solve()
{
    long n;
    cin >> n;
    long check = 0;
    long twos = 0;
    long threes = 0;
    for (long i = 10; n != 0;)
    {
        if (n % i == 2)
        {
            twos++;
        }
        if (n % i == 3)
        {
            threes++;
        }
        check += n % i;
        n /= 10;
    }
    for (int i = 0; i <= twos; i++)
    {
        for (int j = 0; j <= threes; j++)
        {
            int tsum = check;
            tsum += j * 6 + i * 2;
            if (tsum % 9 == 0)
            {
                cout << "YES" << endl;
                return;
            }
        }
    }

    cout << "NO" << endl;
}
int main()
{
    long t;
    cin >> t;
    while (t--)
    {
        solve();
    }
}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

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

using namespace std;
void solve()
{
    long n;
    cin >> n;
    long check = 0;
    long twos = 0;
    long threes = 0;
    for (long i = 10; n != 0;)
    {
        if (n % i == 2)
        {
            twos++;
        }
        if (n % i == 3)
        {
            threes++;
        }
        check += n % i;
        n /= 10;
        check %= 9;
    }
    for (int i = 0; i <= twos; i++)
    {
        for (int j = 0; j <= threes; j++)
        {
            int tsum = check;
            tsum += j * 6 + i * 2;
            if (tsum % 9 == 0)
            {
                cout << "YES" << endl;
                return;
            }
        }
    }

    cout << "NO" << endl;
}
int main()
{
    long t;
    cin >> t;
    while (t--)
    {
        solve();
    }
}

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

using namespace std;
void solve()
{
    string s;
    cin >> s;
    int sum = 0, twos = 0, threes = 0;
    for (auto i : s)
    {
        if (i == '2')
        {
            twos++;
        }
        else if (i == '3')
        {
            threes++;
        }
        sum += (i - '0');
        sum %= 9;
    }

    for (int i = 0; i <= threes; i++)
    {
        for (int j = 0; j < twos; j++)
        {
            long tsum = sum;
            tsum += j * 2 + i * 6;
            if (tsum % 9 == 0)
            {
                cout << "YES" << endl;
                return;
            }
        }
    }
    cout << "NO" << endl;
}
int main()
{
    long t;
    cin >> t;
    while (t--)
    {
        solve();
    }
}