ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2062C - Cirno and Operations
Language: C++20 (GCC 13-64)

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

void solve(){
	int n; cin >> n; 
	vector<int64_t> a(n); for(int64_t& i : a ) cin >> i ;
	if(n == 1){
		cout << a[0] << '\n';
		return;
	}
	int64_t sum = accumulate(a.begin(),a.end(),0ll);
	sum = max(sum,-sum);
	while( n > 1){
		for(int i = 0; i < n-1; i++){
			a[i] = a[i+1] - a[i];
		}
		a[n-1] = 0;
		int64_t x = accumulate(a.begin(),a.end(),0ll);
		n--;
		x = max(x,-x);
		sum = max(x,sum);
	}
	cout << sum << '\n';
			
	
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int tc; cin >> tc;
	while(tc--){
		solve();
	}
	return 0 ;
}


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

void solve(){
	int n; cin >> n; 
	vector<int64_t> a(n); for(int64_t& i : a ) cin >> i ;
	int64_t sum = accumulate(a.begin(),a.end(),0ll);
	while( n > 1){
		for(int i = 0; i < n-1; i++){
			a[i] = a[i+1] - a[i];
		}
		a[n-1] = 0;
		int64_t x = accumulate(a.begin(),a.end(),0ll);
		n--;
		x = max(x,-x);
		sum = max(x,sum);
	}
	cout << sum << '\n';
			
	
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int tc; cin >> tc;
	while(tc--){
		solve();
	}
	return 0 ;
}
Problem: 2062C - Cirno and Operations
Language: C++20 (GCC 13-64)


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

void solve(){
	int n; cin >> n; 
	vector<int> a(n); for(int& i : a ) cin >> i ;
	int64_t sum = accumulate(a.begin(),a.end(),0ll);
	sum = max(sum,-sum);
	while( n > 1){
		for(int i = 0; i < n-1; i++){
			a[i] = a[i+1] - a[i];
		}
		a[n-1] = 0;
		int64_t x = accumulate(a.begin(),a.end(),0ll);
		n--;
		x = max(x,-x);
		sum = max(x,sum);
	}
	cout << sum << '\n';
			
	
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int tc; cin >> tc;
	while(tc--){
		solve();
	}
	return 0 ;
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

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

int main() {
    int t;cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector<vector<long long int>> a;
        vector<long long int> b(n,0);
        long long int ans=0;
        for(int i=0;i<n;i++){
            cin>>b[i];
            ans+=b[i];
        }
        a.push_back(b);
        if(n==1){cout<<max(-1000,b[0])<<endl;continue;}
        
        for(int j=1;j<n;j++){
            vector<long long int> temp(n-j);
            for(int i=0;i<n-j;i++){
                temp[i]=a[j-1][i+1]-a[j-1][i];
 
            }
            long long int sum=0;
            a.push_back(temp);
            for(int i=0;i<n-j;i++){
                sum+=temp[i];

            }
            ans=max(abs(sum),ans);
        }
        cout<<ans<<endl;
    }
}

Submission (verdict: Compilation error):
#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector<vector<long long int>> a;
        vector<long long int> b(n,0);
        long long int ans=0;
        for(int i=0;i<n;i++){
            cin>>b[i];
            ans+=b[i];
        }
        a.push_back(b);
        long long int c=max(-1000,b[0]);
        if(n==1){cout<<c<<endl;continue;}
        
        for(int j=1;j<n;j++){
            vector<long long int> temp(n-j);
            for(int i=0;i<n-j;i++){
                temp[i]=a[j-1][i+1]-a[j-1][i];
 
            }
            long long int sum=0;
            a.push_back(temp);
            for(int i=0;i<n-j;i++){
                sum+=temp[i];

            }
            ans=max(abs(sum),ans);
        }
        cout<<ans<<endl;
    }
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector<vector<long long int>> a;
        vector<long long int> b(n,0);
        long long int ans=0;
        for(int i=0;i<n;i++){
            cin>>b[i];
            ans+=b[i];
        }
        a.push_back(b);
        if(n==1){cout<<-1000<<endl;continue;}
        
        for(int j=1;j<n;j++){
            vector<long long int> temp(n-j);
            for(int i=0;i<n-j;i++){
                temp[i]=a[j-1][i+1]-a[j-1][i];
 
            }
            long long int sum=0;
            a.push_back(temp);
            for(int i=0;i<n-j;i++){
                sum+=temp[i];

            }
            ans=max(abs(sum),ans);
        }
        cout<<ans<<endl;
    }
}

Submission (verdict: Compilation error):
#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector<vector<long long int>> a;
        vector<long long int> b(n,0);
        long long int ans=0;
        for(int i=0;i<n;i++){
            cin>>b[i];
            ans+=b[i];
        }
        a.push_back(b);
        if(n==1){cout<<max(-1000,b[0])<<endl;continue;}
        
        for(int j=1;j<n;j++){
            vector<long long int> temp(n-j);
            for(int i=0;i<n-j;i++){
                temp[i]=a[j-1][i+1]-a[j-1][i];
 
            }
            long long int sum=0;
            a.push_back(temp);
            for(int i=0;i<n-j;i++){
                sum+=temp[i];

            }
            ans=max(abs(sum),ans);
        }
        cout<<ans<<endl;
    }
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)


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

int main() {
    int t;cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector<vector<long long int>> a;
        vector<long long int> b(n,0);
        long long int ans=0;
        for(int i=0;i<n;i++){
            cin>>b[i];
            ans+=b[i];
        }
        a.push_back(b);
        if(n==1){cout<<-1000<<endl;continue;}
        
        for(int j=1;j<n;j++){
            vector<long long int> temp(n-j);
            for(int i=0;i<n-j;i++){
                temp[i]=a[j-1][i+1]-a[j-1][i];
 
            }
            long long int sum=0;
            a.push_back(temp);
            for(int i=0;i<n-j;i++){
                sum+=temp[i];

            }
            ans=max(abs(sum),ans);
        }
        cout<<ans<<endl;
    }
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

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

int main() {
    int t;cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector<vector<long long int>> a;
        vector<long long int> b(n,0);
        long long int ans=0;
        for(int i=0;i<n;i++){
            cin>>b[i];
            ans+=b[i];
        }
        a.push_back(b);
        long long int c=max(-1000,b[0]);
        if(n==1){cout<<c<<endl;continue;}
        
        for(int j=1;j<n;j++){
            vector<long long int> temp(n-j);
            for(int i=0;i<n-j;i++){
                temp[i]=a[j-1][i+1]-a[j-1][i];
 
            }
            long long int sum=0;
            a.push_back(temp);
            for(int i=0;i<n-j;i++){
                sum+=temp[i];

            }
            ans=max(abs(sum),ans);
        }
        cout<<ans<<endl;
    }
}

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

int main() {
    int t;cin>>t;
    while(t--){
        int n;
        cin>>n;
        vector<vector<long long int>> a;
        vector<long long int> b(n,0);
        long long int ans=0;
        for(int i=0;i<n;i++){
            cin>>b[i];
            ans+=b[i];
        }
        a.push_back(b);
        if(n==1){cout<<b[0]<<endl;continue;}
        
        for(int j=1;j<n;j++){
            vector<long long int> temp(n-j);
            for(int i=0;i<n-j;i++){
                temp[i]=a[j-1][i+1]-a[j-1][i];
 
            }
            long long int sum=0;
            a.push_back(temp);
            for(int i=0;i<n-j;i++){
                sum+=temp[i];

            }
            ans=max(abs(sum),ans);
        }
        cout<<ans<<endl;
    }
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)


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



using namespace std;



#define endl '\n'

#define int long long



const int MOD = 1e9 + 7;

const int INF = LLONG_MAX >> 1;



signed main() {

    ios::sync_with_stdio(false);

    cin.tie(NULL);

    int t;

    cin >> t;

    while (t--)

    {

        string s;

        cin>>s;

        sort(s.begin(),s.end());

        int sum=0;

        for(int i=0;i<s.size();i++)

        {

            int x=s[i]-'0';

            sum=sum+x;

        }

       // cout<<"sum "<<sum<<endl;

        if(sum%9==0)

        {

            cout<<"YES"<<endl;

            continue;

        }

        

        bool b=0;

        for(int i=0;i<s.size();i++)

        {

            int x=s[i]-'0';

            if(x>3)

            {

                break;

            }

            else if(x==0 || x==1)

            {

                continue;

            }

            else

            {

                int a=x;

                while(a*1ll*a<10)

                {

                    a=a*1ll*a;

                    sum=sum+a;

                    sum=sum-x;

                    if(sum%9==0)

                    {

                        b=1;

                        break;

                    }

                    x=a;

                }

                if(sum%9==0)

                    break;

            }

            

            

        }

        if(b)

        {

            cout<<"YES"<<endl;

        }

        else

        {

            cout<<"NO"<<endl;

        }

    }

}
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)


Submission (verdict: Time limit exceeded on test 6):
#include<bits/stdc++.h>
using namespace std;
int main() {
	string s;
	int T,len,x;
	cin>>T;
	while(T--) {
		cin>>s;
		len=s.size();
		x=len;
		while(x--) {
			for(int i=len-1; i>0; i--) {
				if(s[i]==0)continue;
				int j=i;
				while(s[j]>s[j-1]+1) {
					if(s[j]==0)break;
					s[j]-=1;
					swap(s[j],s[j-1]);
					j--;
					if(j==0)break;
				}
			}
		}
		cout<<s<<endl;
	}
	return 0;
}
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)

Previous submission (verdict: Time limit exceeded on test 6):
#include<bits/stdc++.h>
using namespace std;
int main() {
	string s;
	int T,len,x;
	cin>>T;
	while(T--) {
		cin>>s;
		len=s.size();
		x=len;
		while(x--) {
			for(int i=len-1; i>0; i--) {
				if(s[i]==0)continue;
				int j=i;
				while(s[j]>s[j-1]+1) {
					if(s[j]==0)break;
					s[j]-=1;
					swap(s[j],s[j-1]);
					j--;
					if(j==0)break;
				}
			}
		}
		cout<<s<<endl;
	}
	return 0;
}

Submission (verdict: Time limit exceeded on test 6):
#include<bits/stdc++.h>
using namespace std;
int main() {
	string s;
	int T,len,x;
	cin>>T;
	while(T--) {
		cin>>s;
		len=s.size();
		x=len;
		int k=0;
		while(x--) {
			for(int i=len-1; i>k; i--) {
				if(s[i]==0)continue;
				int j=i;
				while(s[j]>s[j-1]+1) {
					if(s[j]==0)break;
					s[j]-=1;
					swap(s[j],s[j-1]);
					j--;
					if(j==0)break;
				}
			}
			k++;
		}
		cout<<s<<endl;
	}
	return 0;
}
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)

Previous submission (verdict: Time limit exceeded on test 6):
#include<bits/stdc++.h>
using namespace std;
int main() {
	string s;
	int T,len,x;
	cin>>T;
	while(T--) {
		cin>>s;
		len=s.size();
		x=len;
		int k=0;
		while(x--) {
			for(int i=len-1; i>k; i--) {
				if(s[i]==0)continue;
				int j=i;
				while(s[j]>s[j-1]+1) {
					if(s[j]==0)break;
					s[j]-=1;
					swap(s[j],s[j-1]);
					j--;
					if(j==0)break;
				}
			}
			k++;
		}
		cout<<s<<endl;
	}
	return 0;
}

Submission (verdict: Accepted):
#include<bits/stdc++.h>
using namespace std;
int main() {
	string s;
	int T,len,x;
	cin>>T;
	while(T--) {
		cin>>s;
		len=s.size();
		x=len;
	
			for(int i=1; i<len; i++) {
				if(s[i]==0)continue;
				int j=i; 
				while(s[j]>s[j-1]+1) {
					if(s[j]==0)break;
					s[j]-=1;
					swap(s[j],s[j-1]);
					j--;
					if(j==0)break;
				}
			}
		
		cout<<s<<endl;
	}
	return 0;
}
Problem: 2050D - Digital string maximization
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 3):
import sys 
from math import*
from collections import*
I=lambda: map(int,input())
for i in range(int(input())):
    a=list(I())
    n=len(a)
    for j in range(n-1,-1,-1):
        for k in range(j,min(j+9,n-1)):
            if a[k+1]-1>a[k]:
                a[k],a[k+1]=a[k+1]-1,a[k]
                
    print(*a,sep="")

Submission (verdict: Wrong answer on test 3):
import sys 
from math import*
from collections import*
I=lambda: map(int,input())
for i in range(int(input())):
    a=list(I())
    n=len(a)
    for j in range(n-1,-1,-1):
        for k in range(j,min(j+11,n-1)):
            if a[k+1]-1>a[k]:
                a[k],a[k+1]=a[k+1]-1,a[k]
                
    print(*a,sep="")
Problem: 2050D - Digital string maximization
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 3):
import sys 
from math import*
from collections import*
I=lambda: map(int,input())
for i in range(int(input())):
    a=list(I())
    n=len(a)
    for j in range(n-1,-1,-1):
        for k in range(j,min(j+20,n-1)):
            if a[k+1]-1>a[k]:
                a[k],a[k+1]=a[k+1]-1,a[k]
                
    print(*a,sep="")

Submission (verdict: Wrong answer on test 8):
import sys 
from math import*
from collections import*
I=lambda: map(int,input())
for i in range(int(input())):
    a=list(I())
    n=len(a)
    for j in range(n-1,-1,-1):
        for k in range(j,min(j+100,n-1)):
            if a[k+1]-1>a[k]:
                a[k],a[k+1]=a[k+1]-1,a[k]
                
    print(*a,sep="")
Problem: 2050D - Digital string maximization
Language: PyPy 3-64


Submission (verdict: Wrong answer on test 3):
import sys 
from math import*
from collections import*
I=lambda: map(int,input())
for i in range(int(input())):
    a=list(I())
    n=len(a)
    for j in range(n-1,-1,-1):
        for k in range(j,min(j+9,n-1)):
            if a[k+1]-1>a[k]:
                a[k],a[k+1]=a[k+1]-1,a[k]
                
    print(*a,sep="")
Problem: 2050D - Digital string maximization
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 8):
import sys 
from math import*
from collections import*
I=lambda: map(int,input())
for i in range(int(input())):
    a=list(I())
    n=len(a)
    for j in range(n-1,-1,-1):
        for k in range(j,min(j+100,n-1)):
            if a[k+1]-1>a[k]:
                a[k],a[k+1]=a[k+1]-1,a[k]
                
    print(*a,sep="")

Submission (verdict: Accepted):
import sys 
from math import*
from collections import*
I=lambda: map(int,input())
for i in range(int(input())):
    a=list(I())
    n=len(a)
    for j in range(n):
        for k in range(j,max(0,j-10,),-1):
            if a[k-1]+1<a[k]:
                a[k],a[k-1]=a[k-1],a[k]-1
                
    print(*a,sep="")
Problem: 2050D - Digital string maximization
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 3):
import sys 
from math import*
from collections import*
I=lambda: map(int,input())
for i in range(int(input())):
    a=list(I())
    n=len(a)
    for j in range(n-1,-1,-1):
        for k in range(j,min(j+11,n-1)):
            if a[k+1]-1>a[k]:
                a[k],a[k+1]=a[k+1]-1,a[k]
                
    print(*a,sep="")

Submission (verdict: Wrong answer on test 3):
import sys 
from math import*
from collections import*
I=lambda: map(int,input())
for i in range(int(input())):
    a=list(I())
    n=len(a)
    for j in range(n-1,-1,-1):
        for k in range(j,min(j+20,n-1)):
            if a[k+1]-1>a[k]:
                a[k],a[k+1]=a[k+1]-1,a[k]
                
    print(*a,sep="")
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 4):
#include<bits/stdc++.h>
using namespace std;

#define int long long
#define Int __int128_t
#define bpc(x) __builtin_popcountll(x)
#define msb(x) (63-__builtin_clzll(x))

#ifdef DEBUG
#define dbg(x) cout<<"["<< #x <<"] : "<<(x)<<endl;
#else
#define dbg(x)
#endif

int bpow(int a, int b, long long mod=LLONG_MAX){
	int res=1;while(b){if(b%2)res=res*a%mod;a=a*a%mod;b/=2;}return res;
}
int inv(int a, int mod=1e9+7){ return bpow(a, mod-2, mod); }

void doumo_same_desu(); int TC, ALLTC;
signed main(){
	ios_base::sync_with_stdio(false);cin.tie(0); cout.tie(0);
	cout << fixed << setprecision(5);

	// cin >> ALLTC; for(TC=1;TC<=ALLTC;TC++)
  doumo_same_desu();
}

void doumo_same_desu(){
  int n;
  cin >> n;
  vector<int>ar(n + 1), pos(n + 1);
  for(int i = 1; i <= n; i++){
    cin >> ar[i];
    pos[ar[i]] = i;
  }

  vector<pair<int,int>>res;
  for(int i = 1; i <= n; i++){
    for(int j = i + 1; j <= n; j++){
      // i < j
      if(pos[i] < pos[j]){
        res.push_back({j, i});
        res.push_back({i, j});
      }
      if(pos[j] < pos[i]){
        res.push_back({j, i});
      }
    }
  }
  cout << (int)res.size() << '\n';
  for(auto[x,y]: res) cout << x << ' ' << y << '\n';
}

/*

*/
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 4):
#include<bits/stdc++.h>
using namespace std;

#define int long long
#define Int __int128_t
#define bpc(x) __builtin_popcountll(x)
#define msb(x) (63-__builtin_clzll(x))

#ifdef DEBUG
#define dbg(x) cout<<"["<< #x <<"] : "<<(x)<<endl;
#else
#define dbg(x)
#endif

int bpow(int a, int b, long long mod=LLONG_MAX){
	int res=1;while(b){if(b%2)res=res*a%mod;a=a*a%mod;b/=2;}return res;
}
int inv(int a, int mod=1e9+7){ return bpow(a, mod-2, mod); }

void doumo_same_desu(); int TC, ALLTC;
signed main(){
	ios_base::sync_with_stdio(false);cin.tie(0); cout.tie(0);
	cout << fixed << setprecision(5);

	// cin >> ALLTC; for(TC=1;TC<=ALLTC;TC++)
  doumo_same_desu();
}

void doumo_same_desu(){
  int n;
  cin >> n;
  vector<int>ar(n + 1), pos(n + 1);
  for(int i = 1; i <= n; i++){
    cin >> ar[i];
    pos[ar[i]] = i;
  }

  vector<pair<int,int>>res;
  for(int i = 1; i <= n; i++){
    for(int j = i + 1; j <= n; j++){
      // i < j
      if(pos[i] < pos[j]){
        res.push_back({j, i});
        res.push_back({i, j});
      }
      if(pos[j] < pos[i]){
        res.push_back({j, i});
      }
    }
  }
  cout << (int)res.size() << '\n';
  for(auto[x,y]: res) cout << x << ' ' << y << '\n';
}

/*

*/


Submission (verdict: Wrong answer on test 5):
#include<bits/stdc++.h>
using namespace std;

#define int long long
#define Int __int128_t
#define bpc(x) __builtin_popcountll(x)
#define msb(x) (63-__builtin_clzll(x))

#ifdef DEBUG
#define dbg(x) cout<<"["<< #x <<"] : "<<(x)<<endl;
#else
#define dbg(x)
#endif

int bpow(int a, int b, long long mod=LLONG_MAX){
	int res=1;while(b){if(b%2)res=res*a%mod;a=a*a%mod;b/=2;}return res;
}
int inv(int a, int mod=1e9+7){ return bpow(a, mod-2, mod); }

void doumo_same_desu(); int TC, ALLTC;
signed main(){
	ios_base::sync_with_stdio(false);cin.tie(0); cout.tie(0);
	cout << fixed << setprecision(5);

	// cin >> ALLTC; for(TC=1;TC<=ALLTC;TC++)
  doumo_same_desu();
}


void doumo_same_desu(){
  int n;
  cin >> n;
  vector<int> st(n+1), final(n+1);;
  vector<vector<bool>> used(n + 1, vector<bool>(n + 1, 0));
  for(int i = 1; i <= n; i++){
    cin >> final[i];
    st[i] = i;
  }

  vector<pair<int,int>> res;
  for(int i = 1; i <= n; i++){ // order by final pos
    int now = final[i];

    // cout << "mundur " << i << '\n';;
    // bawa mundur
    while(now + 1 <= n && !used[st[now + 1]][st[now]]){
      res.push_back({st[now + 1], st[now]});
      // cout << res.back().first << ' ' << res.back().second << '\n';
      used[st[now + 1]][st[now]] = 1;
      swap(st[now + 1], st[now]);
      now++;
    }

    // cout <<"maju " << i << '\n';
    // bawa maju lagi
    while(now - 1 >= i && !used[st[now]][st[now - 1]]){
      res.push_back({st[now], st[now - 1]});
      // cout << res.back().first << ' ' << res.back().second << '\n';
      used[st[now]][st[now - 1]] = 1;
      swap(st[now], st[now - 1]);
      now--;
    }
  }
  cout << (int)res.size() << '\n';
  for(auto[x,y]:res) cout << x << ' ' << y << '\n';
}

/*

*/
Problem: 2050C - Uninteresting Number
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 1):
def main():
    test_case = int(input())
    for _ in range(test_case):
        num = list(map(int,input().split()))
        solve(num)


def solve(num):
    two = num.count(2)
    three = num.count(3)
    tot = sum(num)
    for i in range(min(10,two+1)):
        for j in range((min(10,three+1))):
            if (tot+ 2*i+ 6*j)%9 == 0:
                print("YES")
                return
    print("NO")    
main()


Submission (verdict: Accepted):
def main():
    test_case = int(input())
    for _ in range(test_case):
        num = [int(x) for x in input()]
        solve(num)


def solve(num):
    two = num.count(2)
    three = num.count(3)
    tot = sum(num)
    for i in range(min(10,two+1)):
        for j in range((min(10,three+1))):
            if (tot+ 2*i+ 6*j)%9 == 0:
                print("YES")
                return
    print("NO")    
main()
Problem: 2050C - Uninteresting Number
Language: PyPy 3-64

Previous submission (verdict: Runtime error on test 4):
def main():
    test_case = int(input())
    for _ in range(test_case):
        num = int(input())
        solve(num)


def solve(num):
    two = three = tot = 0
    while num :
        dig = num%10
        tot += dig
        if dig == 2:two += 1
        if dig == 3:three += 1
        num //= 10
    for i in range(min(10,two+1)):
        for j in range((min(10,three+1))):
            if (tot+ 2*i+ 6*j)%9 == 0:
                print("YES")
                return
    print("NO")    
main()


Submission (verdict: Wrong answer on test 1):
def main():
    test_case = int(input())
    for _ in range(test_case):
        num = list(map(int,input().split()))
        solve(num)


def solve(num):
    two = num.count(2)
    three = num.count(3)
    tot = sum(num)
    for i in range(min(10,two+1)):
        for j in range((min(10,three+1))):
            if (tot+ 2*i+ 6*j)%9 == 0:
                print("YES")
                return
    print("NO")    
main()
Problem: 2050C - Uninteresting Number
Language: PyPy 3-64

Previous submission (verdict: Runtime error on test 4):
def main():
    test_case = int(input())
    for _ in range(test_case):
        num = int(input())
        solve(num)


def solve(num):
    two = three = tot = 0
    while num :
        dig = num%10
        tot += dig
        if dig == 2:two += 1
        if dig == 3:three += 1
        num //= 10
    for i in range(two+1):
        for j in range(three+1):
            if (tot+ 2*i+ 6*j)%9 == 0:
                print("YES")
                return
    print("NO")    
main()


Submission (verdict: Runtime error on test 4):
def main():
    test_case = int(input())
    for _ in range(test_case):
        num = int(input())
        solve(num)


def solve(num):
    two = three = tot = 0
    while num :
        dig = num%10
        tot += dig
        if dig == 2:two += 1
        if dig == 3:three += 1
        num //= 10
    for i in range(min(10,two+1)):
        for j in range((min(10,three+1))):
            if (tot+ 2*i+ 6*j)%9 == 0:
                print("YES")
                return
    print("NO")    
main()
Problem: 2050C - Uninteresting Number
Language: PyPy 3-64


Submission (verdict: Runtime error on test 4):
def main():
    test_case = int(input())
    for _ in range(test_case):
        num = int(input())
        solve(num)


def solve(num):
    two = three = tot = 0
    while num :
        dig = num%10
        tot += dig
        if dig == 2:two += 1
        if dig == 3:three += 1
        num //= 10
    for i in range(two+1):
        for j in range(three+1):
            if (tot+ 2*i+ 6*j)%9 == 0:
                print("YES")
                return
    print("NO")    
main()