criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define all(x) (x).begin(),(x).end()
#define V vector
typedef V<int> vi;
typedef V<vi> vvi;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
constexpr auto INF = INT_MAX >> 1;
constexpr auto LINF = 5000000000000000LL;
constexpr auto MOD = 1000000007;

int main() {

	int n, a, b, c;
	cin >> n >> a >> b >> c;
	string select = "";
	rep(i, n) {
		string s;
		cin >> s;
		if (s == "AB")select.push_back('0');
		if (s == "AC")select.push_back('1');
		if (s == "BC")select.push_back('2');
	}

	string ans = "";
	rep(i, n) {
		int s = select[i] - '0';
		if (s == 0) {
			bool a_plus = 0;
			if (a < b)a_plus++;
			if (a == b && i < n - 1)if (select[i + 1] == '1')a_plus++;
			if (a_plus) {
				a++;
				b--;
				ans.push_back('A');
			}
			else {
				a--;
				b++;
				ans.push_back('B');
			}
		}
		if (s == 1) {
			bool a_plus = 0;
			if (a < c)a_plus++;
			if (a == c && i < n - 1)if (select[i + 1] == '0')a_plus++;
			if (a_plus) {
				a++;
				c--;
				ans.push_back('A');
			}
			else {
				a--;
				c++;
				ans.push_back('C');
			}	
		}
		if (s == 2) {
			bool b_plus = 0;
			if (b < c)b_plus++;
			if (b == c && i < n - 1)if (select[i + 1] == '0')b_plus++;
			if (b_plus) {
				b++;
				c--;
				ans.push_back('B');
			}
			else {
				b--;
				c++;
				ans.push_back('C');
			}
		}
		if (a < 0 || b < 0 || c < 0) {
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;
	rep(i, n)cout << ans[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:35: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   34 |                         if (a < b)a_plus++;
      |                                   ^~~~~~
a.cc:35:74: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   35 |                         if (a == b && i < n - 1)if (select[i + 1] == '1')a_plus++;
      |                                                                          ^~~~~~
a.cc:49:35: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   49 |                         if (a < c)a_plus++;
      |                                   ^~~~~~
a.cc:50:74: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   50 |                         if (a == c && i < n - 1)if (select[i + 1] == '0')a_plus++;
      |                                                                          ^~~~~~
a.cc:64:35: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   64 |                         if (b < c)b_plus++;
      |                                   ^~~~~~
a.cc:65:74: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   65 |                         if (b == c && i < n - 1)if (select[i + 1] == '0')b_plus++;
      |                                                                          ^~~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

long long N, A, B, C;
bool dp[100009][12][12][12];
string S[1 << 18];

int main() {
	cin >> N >> A >> B >> C;
	for (int i = 1; i <= N; i++) cin >> S[i];

	if (A + B + C >= 10) {
		vector<char> CC;
		for (int i = 1; i <= N; i++) {
			if (S[i] == "AB") { if (A > B) { CC.push_back('B'); A--; B++; } else { CC.push_back('A'); A++; B--; } }
			if (S[i] == "AC") { if (A > C) { CC.push_back('C'); A--; C++; } else { CC.push_back('A'); A++; C--; } }
			if (S[i] == "BC") { if (B > C) { CC.push_back('C'); B--; C++; } else { CC.push_back('B'); B++; C--; } }
			if (A < 0 || B < 0 || C < 0) {
				cout << "No" << endl;
				return 0;
			}
		}
		cout << "Yes" << endl;
		for (int i = 0; i < CC.size(); i++) cout << CC[i] << endl;
	}
	else {
		dp[0][A][B][C] = true;
		for (int i = 1; i <= N; i++) {
			for (int j = 0; j <= A + B + C; j++) {
				for (int k = 0; k <= A + B + C; k++) {
					for (int l = 0; l <= A + B + C; l++) {
						if (dp[i - 1][j][k][l] == false) continue;
						if (S[i] == "AB") {
							int v1 = j, v2 = k, v3 = l;
							if (v2 >= 1) { dp[i][v1 + 1][v2 - 1][v3] = true; }
							if (v1 >= 1) { dp[i][v1 - 1][v2 + 1][v3] = true; }
						}
						if (S[i] == "AC") {
							int v1 = j, v2 = k, v3 = l;
							if (v3 >= 1) { dp[i][v1 + 1][v2][v3 - 1] = true; }
							if (v1 >= 1) { dp[i][v1 - 1][v2][v3 + 1] = true; }
						}
						if (S[i] == "BC") {
							int v1 = j, v2 = k, v3 = l;
							if (v3 >= 1) { dp[i][v1][v2 + 1][v3 - 1] = true; }
							if (v2 >= 1) { dp[i][v1][v2 - 1][v3 + 1] = true; }
						}
					}
				}
			}
		}

		int s1 = 0, s2 = 0, s3 = -1;
		for (int i = 0; i <= A + B + C; i++) {
			for (int j = 0; j <= A + B + C; j++) {
				for (int k = 0; k <= A + B + C; k++) {
					if (dp[N][i][j][k] == true) { s1 = i; s2 = j; s3 = k; }
				}
			}
		}

		if (s1 + s2 + s3 == -1) {
			cout << "No" << endl;
			return 0;
		}

		vector<char>CC;
		for (int i = N; i >= 1; i--) {
			if (S[i] == "AB") {
				if (s2 >= 1 && dp[i - 1][s1 + 1][s2 - 1][s3] == true) { CC.push_back('B'); s1++; s2--; }
				else { CC.push_back('A'); s1--; s2++; }
			}
			if (S[i] == "AC") {
				if (s3 >= 1 && dp[i - 1][s1 + 1][s2][s3 - 1] == true) { CC.push_back('C'); s1++; s3--; }
				else { CC.push_back('A'); s1--; s3++; }
			}
			if (S[i] == "BC") {
				if (s3 >= 1 && dp[i - 1][s1][s2 + 1][s3 - 1] == true) { CC.push_back('C'); s2++; s3--; }
				else { CC.push_back('B'); s2--; s3++; }
			}
		}
		reverse(CC.begin(), CC.end());

		cout << "Yes" << endl;
		for (int i = 0; i < N; i++) cout << CC[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:83:17: error: 'reverse' was not declared in this scope
   83 |                 reverse(CC.begin(), CC.end());
      |                 ^~~~~~~
Language: C++

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

using ll = long long;
using P = pair<int, int>;
#define reps(i,n) for (int i=1; i<=n; i++)
#define zarray(x,n) x[n+1]; reps(i,n) {x[i]=0;} 
#define zarray2(x,n,m) x[n+1][m+1]; reps(i,n) { reps(j,m) {x[i][j]=0;}}

int main() {
    int n,a,b,c;
    cin >> n >> a >> b >> c;
    if (a+b+c == 0) {
            cout << "No" << endl;
            return;
    }
    int ra = a,rb=b,rc=c;
    string s[n+1];
    reps(i,n) {
        cin >> s[i];
        if (s[i] == "AB") {
            ra--; rb--;
        }
         else if (s[i] == "AC") {
            ra--; rc--;
        }
         else if (s[i] == "BC") {
            rb--; rc--;
        }
    }

    string ans[n+1];
    reps(i,n) {
        //cerr <<s[i] << ":" << ra << " " << rb << " " << rc << " - " << a << " " << b << " " << c << endl;
        if (s[i] == "AB") {
            if (ra < rb) {
                ans[i] = "A";
                a++; ra++;
                b--; rb--;
            } else {
                ans[i] = "B";
                b++; rb++;
                a--; ra--;
            }
        } else if (s[i] == "AC") {
            if (ra < rc) {
                ans[i] = "A";
                a++; ra++; 
                c--; rc--;
            } else {
                ans[i] = "C";
                c++; rc++;
                a--; ra--;
            }

        } else {
            if (rb < rc) {
                ans[i] = "B";
                b++; rb++;
                c--; rc--;
            } else {
                ans[i] = "C";
                c++; rc++;
                b--; rb--;
            }

        }
        if (a<0 || b<0 || c<0) {
            cout << "No" << endl;
            return;
        }
    }

    cout << "Yes" << endl;
    reps(i,n) {
        cout << ans[i] << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   15 |             return;
      |             ^~~~~~
a.cc:70:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   70 |             return;
      |             ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
long long N,A,B,C;
cin>>N>>A>>B>>C;
string s1,s2; 
string a[N]={};
int death=0;
cin>>s1;
for(int i=0;i<N-1;i++){
cin>>s2;
if(s1=="AB"){
if(A==0&&B==0){
death++;}
if(A>B||(A==B&&s2!="AC")){
a[i]="B";
B++;
A--;}
else{
a[i]="A";
A++;
B--;}}
if(s1=="AC"){
if(A==0&&C==0){
death++;}
if(A>C||(A==C&&s2!="AB")){
a[i]="C";
C++;
A--;}
else{
a[i]="A";
A++;
C--;}}
if(s1=="BC"){
if(B==0&&C==0){
death++;}
if(C>B||(C==B&&s2!="AC")){
a[i]="B";
B++;
C--;}
else{
a[i]="C";
C++;
B--;
s1=s2;}}}
if(s1=="AB"){
if(A==0&&B==0){
death++;}
if(A>B){
a[N-1]="B";
B++;
A--;}
else{
a[N-1]="A";
A++;
B--;}}
if(s1=="AC"){
if(A==0&&C==0){
death++;}
if(A>C){
a[N-1]="C";
C++;
A--;}
else{
a[N-1]="A";
A++;
C--;}}
if(s1=="BC"){
if(B==0&&C==0){
death++;}
if(C>B){
a[N-1]="B";
B++;
C--;}
else{
a[N-1]="C";
C++;
B--;
}
if(death!=0){
cout<<"No"<<endl;}
else{
cout<<"Yes"<<endl;
for(int i=0;i<N;i++){
cout<<a[i]<<endl;}}}


Compiler output:
a.cc: In function 'int main()':
a.cc:85:21: error: expected '}' at end of input
   85 | cout<<a[i]<<endl;}}}
      |                     ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
long long N,A,B,C;
cin>>N>>A>>B>>C;
string s1,s2; 
string a[N]={};
int death=0;
cin>>s1;
for(int i=0;i<N-1;i++){
cin>>s2;
if(s1=="AB"){
if(A==0&&B==0){
death++;}
if(A>B||A==B&&s2!="AC"){
a[i]="B";
B++;
A--;}
else{
a[i]="A";
A++;
B--;}}
if(s=="AC"){
if(A==0&&C==0){
death++;}
if(A>C||A==C&&s2!="AB"){
a[i]="C";
C++;
A--;}
else{
a[i]="A";
A++;
C--;}}
if(s=="BC"){
if(B==0&&C==0){
death++;}
if(C>B||C==B&&s2!="AC"){
a[i]="B";
B++;
C--;}
else{
a[i]="C";
C++;
B--;
s1=s2;}}}
if(s1=="AB"){
if(A==0&&B==0){
death++;}
if(A>B){
a[N-1]="B";
B++;
A--;}
else{
a[N-1]="A";
A++;
B--;}}
if(s1=="AC"){
if(A==0&&C==0){
death++;}
if(A>C){
a[N-1]="C";
C++;
A--;}
else{
a[N-1]="A";
A++;
C--;}}
if(s1=="BC"){
if(B==0&&C==0){
death++;}
if(C>B){
a[N-1]="B";
B++;
C--;}
else{
a[N-1]="C";
C++;
B--;
}
if(death!=0){
cout<<"No"<<endl;}
else{
cout<<"Yes"<<endl;
for(int i=0;i<N;i++){
cout<<a[i]<<endl;}}}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:4: error: 's' was not declared in this scope
   23 | if(s=="AC"){
      |    ^
a.cc:34:4: error: 's' was not declared in this scope
   34 | if(s=="BC"){
      |    ^
a.cc:85:21: error: expected '}' at end of input
   85 | cout<<a[i]<<endl;}}}
      |                     ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
long long N,A,B,C;
cin>>N>>A>>B>>C;
string s; 
if(A+B+C<=1){
cout<<"No"<<endl;}
else{
cout<<"Yes"<<endl;
for(int i=0;i<N;i++){
cin>>s;
if(s=="AB"){
if(A>B){
cout<<"B"<<endl;
B++;}
else{
cout<<"A"<<endl;
A++;}}
if(s=="AC"){
if(A>=C){
cout<<"C"<<endl;
C++;}
else{
cout<<"A"<<endl;
A++;}}
if(s=="BC"){
if(C>=B){
cout<<"B"<<endl;
B++;}
else{
cout<<"C"<<endl;
C++;}}}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

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

#define rep(i, n) for(int i=0; i<n; ++i)

int main(){
   int n, a[3];
   cin>>n>>a[0]>>a[1]>>a[2];
   string s[100000];
   rep(i, n) cin>>s[i];

   int ans[100000];
   rep(i, n){
      int e, f;
      e=s[i][0]-'A';
      f=s[i][1]-'A';
      if(a[e]==0 && a[f]==0){
         cout<<"No"<<endl;
         return 0;
      }
      else if(a[e]==0){
         ans[i]=e; a[e]++; a[f]--;
      }
      else if(a[f]==0){
         ans[i]=f; a[f]++; a[e]--;
      }
      else if(a[e]==1 && a[f]==1 && i!=n-1){
         int g, h;
         g=s[i+1][0]-'A';
         h=s[i+1][1]-'A';
         if(e==g || e==h){
            ans[i]=e; a[e]++; a[f]--;
         }
         else{
            ans[i]=f; a[f]++; a[e]--;
         }
      }
      else{
         if(a[e]<a[f]) ans[i]=e; a[e]++; a[f]--;
         else ans[i]=f; a[f]++; a[e]--;
      }
   }

   cout << "Yes" << endl;
   rep(i, n) cout << (char)('A'+ans[i]) << endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:10: error: 'else' without a previous 'if'
   40 |          else ans[i]=f; a[f]++; a[e]--;
      |          ^~~~
Language: C++

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

#define rep(i, n) for(int i=0; i<n; ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
#define ll long long int

int main(){
   int n, a[3];
   cin>>n>>a[0]>>a[1]>>a[2];
   string s[100000];
   rep(i, n) cin>>s[i];
   
   int ans[100000];
   rep(i, n){
      int e, f;
      e=s[i][0]-'A';
      f=s[i][1]-'A';
      if(a[e]==0 && a[f]==0){
         cout<<"No"<<endl;
         return 0;
      }  
      else if(a[e]==0){
         ans[i]=e;
         a[e]++; a[f]--;
      }  
      else if(a[f]==0){
         ans[i]=f;
         a[f]++; a[e]--;
      }  
      else if(a[e]==1 && a[f]==1 && i!=n-1){
         int g, h;
         g=s[i+1][0]-'A';
         h=s[i+1][1]-'A';
         if(e==g || e==h){
            ans[i]=e;
            a[e]++; a[f]--;
         }  
         else{
            ans[i]=f;
            a[f]++; a[e]--;
         }  
      }  
      else{
         ans[i]=e;
         a[e]++; a[f]--;
      }  
   }

   cout << "Yes" << endl;
   rep(i, n) cout << (char)('A'+ans[i]) << endl;
   return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:10:4: error: 'cin' was not declared in this scope
   10 |    cin>>n>>a[0]>>a[1]>>a[2];
      |    ^~~
a.cc:11:4: error: 'string' was not declared in this scope
   11 |    string s[100000];
      |    ^~~~~~
a.cc:12:19: error: 's' was not declared in this scope
   12 |    rep(i, n) cin>>s[i];
      |                   ^
a.cc:17:9: error: 's' was not declared in this scope
   17 |       e=s[i][0]-'A';
      |         ^
a.cc:20:10: error: 'cout' was not declared in this scope
   20 |          cout<<"No"<<endl;
      |          ^~~~
a.cc:20:22: error: 'endl' was not declared in this scope
   20 |          cout<<"No"<<endl;
      |                      ^~~~
a.cc:50:4: error: 'cout' was not declared in this scope
   50 |    cout << "Yes" << endl;
      |    ^~~~
a.cc:50:21: error: 'endl' was not declared in this scope
   50 |    cout << "Yes" << endl;
      |                     ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

string s[100005];
vector<char> res;

void print(char c){
	res.push_back(c);
}

int main(){
	int N, A, B, C;
	cin>>N>>A>>B>>C;
	for(int i=1; i<=N; ++i) cin>>s[i];
	if(A + B + C == 0){
		puts("No");
		return 0;
	}
	for(int i=1; i<=N; ++i){
		if(s[i] == "AB"){
			if(A > 1 && B > 1) A++, B--, print('A');
			else if(A > 1 && B <= 1) A--, B++, print('B');
			else if(A <= 1 && B > 1) A++, B--, print('A');
			else if(A == 0 && B == 0){
				puts("No");
				return 0;
			}
			else if(A == 1 && B == 0) A--, B++, print('B');
			else if(A == 0 && B == 1) A++, B--, print('A');
			else{
				if(s[i + 1] == "AC") A++, B--, print('A');
				else if(s[i + 1] == "BC") A--, B++, print('B');
				else A++, B--, print('A');
			}
		}
		else if(s[i] == "AC"){
			if(A > 1 && C > 1) A++, C--, print('A');
			else if(A > 1 && C <= 1) A--, C++, print('C');
			else if(A <= 1 && C > 1) A++, C--, print('A');
			else if(A == 0 && C == 0){
				puts("No");
				return 0;
			}
			else if(A == 1 && C == 0) A--, C++, print('C');
			else if(A == 0 && C == 1) A++, C--, print('A');
			else{
				if(s[i + 1] == "AB") A++, C--, print('A');
				else if(s[i + 1] == "BC") A--, C++, print('C');
				else A++, C--, print('A');
			}
		}
		else if(s[i] == "BC"){
			if(B > 1 && C > 1) B++, C--, print('B');
			else if(B > 1 && C <= 1) B--, C++, print('C');
			else if(B <= 1 && C > 1) B++, C--, print('B');
			else if(B == 0 && C == 0){
				puts("No");
				return 0;
			}
			else if(B == 1 && C == 0) B--, C++, print('C');
			else if(B == 0 && C == 1) B++, C--, print('B');
			else{
				if(s[i + 1] == "AB") B++, C--, print('B');
				else if(s[i + 1] == "AC") B--, C++, print('C');
				else B++, C--, print('B');
			}
		}
	}
	puts("Yes");
	for(int i=0; i<res.size(); ++i) printf("%c\n", res[i]);
	return 0;
}


Compiler output:
a.cc:7:1: error: 'vector' does not name a type
    7 | vector<char> res;
      | ^~~~~~
a.cc: In function 'void print(char)':
a.cc:10:9: error: 'res' was not declared in this scope
   10 |         res.push_back(c);
      |         ^~~
a.cc: In function 'int main()':
a.cc:72:24: error: 'res' was not declared in this scope
   72 |         for(int i=0; i<res.size(); ++i) printf("%c\n", res[i]);
      |                        ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)

int main() {
    int n;
	cin >> n;
    int a,b,c;
    cin >> a >> b >> c;
    string s[n];
    string ans="Yes";
    fr(i,n){
     cin >> s[i];
    }
    fr(i,n){
     if(s[i]=="ab"){
       if(a==0&&b=0){
         ans="No";
       }else if(a<b){
         b-=1;
         a+=1;
       }else{
         a-=1;
         b+=1;
       }
     }
      if(s[i]=="ac"){
       if(a==0&&c=0){
         ans="No";
       }else if(a<c){
         c-=1;
         a+=1;
       }else{
         a-=1;
         c+=1;
       }
     }
      if(s[i]=="bc"){
       if(b==0&&c=0){
         ans="No";
       }else if(b<c){
         c-=1;
         b+=1;
       }else{
         b-=1;
         c+=1;
       }
     }
    }
    cout << ans << endl;
  	if(ans=="Yes"){
     fr(i,n){
     if(s[i]=="ab"){
       if(a==0&&b=0){
         ans="No";
       }else if(a<b){
         b-=1;
         a+=1;
         cout << "a" << endl;
       }else{
         a-=1;
         b+=1;
         cout << "b" << endl;
       }
     }
      if(s[i]=="ac"){
       if(a==0&&c=0){
         ans="No";
       }else if(a<c){
         c-=1;
         a+=1;
         cout << "a" << endl;
       }else{
         a-=1;
         c+=1;
         cout << "c" << endl;
       }
     }
      if(s[i]=="bc"){
       if(b==0&&c=0){
         ans="No";
       }else if(b<c){
         c-=1;
         b+=1;
         cout << "b" << endl;
       }else{
         b-=1;
         c+=1;
         cout << "c" << endl;
       }
     }
    }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: lvalue required as left operand of assignment
   21 |        if(a==0&&b=0){
      |           ~~~~^~~
a.cc:32:15: error: lvalue required as left operand of assignment
   32 |        if(a==0&&c=0){
      |           ~~~~^~~
a.cc:43:15: error: lvalue required as left operand of assignment
   43 |        if(b==0&&c=0){
      |           ~~~~^~~
a.cc:58:15: error: lvalue required as left operand of assignment
   58 |        if(a==0&&b=0){
      |           ~~~~^~~
a.cc:71:15: error: lvalue required as left operand of assignment
   71 |        if(a==0&&c=0){
      |           ~~~~^~~
a.cc:84:15: error: lvalue required as left operand of assignment
   84 |        if(b==0&&c=0){
      |           ~~~~^~~
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using namespace std;
typedef pair<ll, ll> pint;

const int MOD = 1000000007;
void yesno(bool b) {
    if (b) {
        cout << "Yes" << endl;
    }     else {
        cout << "No" << endl;
    }
}

int main() {
    int n;
    cin >> n;
    vector<int> d(3);
    rep(i, 3) cin >> d[i];
    vector<P> q;
    rep(i, n) {
        cin >> s;
        int a = 0, b = 1;
        if (s == "AB") a = 0, b = 1;
        if (s == "AC") a = 0, b = 2;
        if (s == "BC") a = 1, b = 2;
        q.emplace_back(a, b);
    }

    string ans;
    auto add = [&](int a, int b) {
        d[a]++;
        d[b]--;
        ans += 'A' + a;
    };
    q.emplace_back(0, 1);
    rep(i, n) {
        int a = q[i].first;
        int b = q[i].second;
        if (!d[a] && !d[b]) {
            cout << "No" << endl;
            return 0;
        }
        if (!d[a]) {
            add(a, b);
        } else if (!d[b]) {
            add(b, a);
        } else {
            int na =  q[i+1].first;
            int nb = q[i+1].second;
            if ( a == na || a == nb) {
                add(a, b);
            } else {
                add(b, a);
            }
        }
    }

    cout << "Yes" << endl;
    rep(i, n) {
        cout << ans[i] << endl;
    }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:12: error: 'P' was not declared in this scope
   28 |     vector<P> q;
      |            ^
a.cc:28:13: error: template argument 1 is invalid
   28 |     vector<P> q;
      |             ^
a.cc:28:13: error: template argument 2 is invalid
a.cc:30:16: error: 's' was not declared in this scope
   30 |         cin >> s;
      |                ^
a.cc:35:11: error: request for member 'emplace_back' in 'q', which is of non-class type 'int'
   35 |         q.emplace_back(a, b);
      |           ^~~~~~~~~~~~
a.cc:44:7: error: request for member 'emplace_back' in 'q', which is of non-class type 'int'
   44 |     q.emplace_back(0, 1);
      |       ^~~~~~~~~~~~
a.cc:46:18: error: invalid types 'int[int]' for array subscript
   46 |         int a = q[i].first;
      |                  ^
a.cc:47:18: error: invalid types 'int[int]' for array subscript
   47 |         int b = q[i].second;
      |                  ^
a.cc:57:24: error: invalid types 'int[int]' for array subscript
   57 |             int na =  q[i+1].first;
      |                        ^
a.cc:58:23: error: invalid types 'int[int]' for array subscript
   58 |             int nb = q[i+1].second;
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  vector<char> ans;
  int n,a,b,c;
  vector<string> d[i];
  cin >> n >>a >>b >>c;
  bool out=false;
  for(int i=0;i<n;i++){
    cin >> d[i];
  }
  for(int i=0;i<n;i++){
   if(d[i]=="AB"){
     if(i!=n-1 && a==1 && b==1 && c==0){
       if (d[i+1]=="BC"){
         ans.push_back('B');
        a--;
        b++;
       }
       else (d[i+1]=="AC"){
         ans.push_back('A');
        a++;
        b--;
       }
     }
     else if(a==0&&b==0)out=true;
      else if(a >= b){
        ans.push_back('B');
        a--;
        b++;
      }
      else{
        ans.push_back('A');
        a++;
        b--;
      }
    }
    else if(d[i]=="BC"){
      if(i!=n-1 && a==0 && b==1 && c==1){
       if (d[i+1]=="AB"){
         ans.push_back('B');
        c--;
        b++;
       }
       else (d[i+1]=="AC"){
         ans.push_back('C');
        c++;
        b--;
       }
     }
      else if(b==0&&c==0)out=true;
      else if(b >= c){
        ans.push_back('C');
        b--;
        c++;
      }
      else{
        ans.push_back('B');
        b++;
        c--;
      }
    }
    if(d[i]=="AC"){
      if(i!=n-1 && a==1 && b==0 && c==1){
       if (d[i+1]=="AB"){
         ans.push_back('A');
        c--;
        a++;
       }
       else (d[i+1]=="BC"){
         ans.push_back('C');
        c++;
        a--;
       }
     }
      else if(c==0&&a==0)out=true;
      else if(c >= a){
        ans.push_back('A');
        c--;
        a++;
      }
      else{
        ans.push_back('C');
        c++;
        a--;
      }
    }
    if(out)break;
  }
  if(out)cout << "No" <<endl;
  else{
    cout << "Yes" <<endl;
    for(int i=0;i<n;i++){
      cout << ans[i] <<endl;
    }
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: 'i' was not declared in this scope
    6 |   vector<string> d[i];
      |                    ^
a.cc:10:12: error: 'd' was not declared in this scope
   10 |     cin >> d[i];
      |            ^
a.cc:13:7: error: 'd' was not declared in this scope
   13 |    if(d[i]=="AB"){
      |       ^
a.cc:63:8: error: 'd' was not declared in this scope
   63 |     if(d[i]=="AC"){
      |        ^
Language: Java

import java.io.*;
import java.util.*;

public class test{
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int[] a = new int[3];
        a[0] = in.nextInt();
        a[1] = in.nextInt();
        a[2] = in.nextInt();
        in.nextLine();
        String[] s = new String[n];
        char[] out = new char[n];
        for(int i = 0; i < n; i++)
            s[i] = in.nextLine();
    

        for(int k = 0; k < n; k++){
            int i = (int)s[k].charAt(0)-(int)'A';
            int j= (int)s[k].charAt(1)-(int)'A';

            if(a[i] > a[j]){
                a[i]--;
                a[j]++;
                out[k] = (s[k].charAt(1));
            }
            else if(a[i] < a[j]){
                a[i]++;
                a[j]--;
                out[k] = (s[k].charAt(0));
            }
            else{
                if(a[i] + a[j] == 0){
                    System.out.println("No");
                    return;
                }
                if(k == n-1 || s[k+1].charAt(0) == s[k].charAt(0) || s[k+1].charAt(1) == s[k].charAt(0)){
                    a[i]++;
                    a[j]--;
                    out[k] = (s[k].charAt(0));
                }
                else{
                    a[i]--;
                    a[j]++;
                    out[k] = (s[k].charAt(1));
                }
            }
        }
        System.out.println("Yes");
        for(int i = 0; i < n; i++)
            System.out.println(out[i]);
    }
}

Compiler output:
Main.java:4: error: class test is public, should be declared in a file named test.java
public class test{
       ^
1 error
Language: C++

#include<bits/stdc++.h>
#define pb push_back
#define pf push_front
#define re(i , n) for(Long i = 0; i < (Long)n ; i++)
#define rer(i, a, b) for (Long i = a, to = b; i < to; i++)
 
using namespace std;
typedef long long Long;
const Long MX=2e5 + 1;
const Long MOD=1000000007;
const Long MX2=9223372036854775806;
 
 
int main(){
	ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
	vector<Long> v(3);
	Long n;cin>>n;
	re(i,3){
		cin>>v[i];
	}
	vector<pair<Long ,Long> > index(n);
	vector<char> resp;
	re(i,n){
		string s;cin>>s;
		index[i].first=s[0]-'A';
		index[i].second=s[1]-'A';	
	}
	re(i,n){
		if(v[index[i].first]==0 && v[index[i].second]==0){
			cout<<"No";
			return 0;
		}
		
		if(v[index[i].first]>0){
			v[index[i].first]--;
			v[index[i].second]++;
			bool hola=true;
			if(!(i<n-1 && v[index[i].first]==0 && v[index[i].second]==0)){
				char l=65+index[i].second;
				resp.pb(l);
				continue;
				hola=false;
			}
			
			v[index[i].first]++;
			v[index[i].second]--;
		}
		if(hola){
			v[index[i].first]++;
			v[index[i].second]--;
			char l=65+index[i].first;
			resp.pb(l);
		
		}
		
	}
	cout<<"Yes\n";
	re(i,resp.size()){
		cout<<resp[i]<<"\n";
	}		
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:20: error: 'hola' was not declared in this scope
   48 |                 if(hola){
      |                    ^~~~
Language: C

#include <bits/stdc++.h>

using namespace std;


void solve(int n, int a, int b, int c, vector<string>& events){
	bool possible = true;
    vector<string> res;
    
    for(int i = 0 ; i < events.size(); i++){
    	if(events[i] == "AB"){
        	if(a == 0 and b == 0){
            	possible = false;
                break;
            }
            else if(a == 1 and b == 1 and c = 0 and i != n and events[i + 1] == "BC"){
            	a -= 1;
                b += 1;
                res.push_back("B");
            }
            else if(a == 1 and b == 1 and c == 0 and i != n and events[i + 1] == "AC"){
            	a += 1;
                b -= 1;
                res.push_back("A");
            }
           else if(a > b){
           		a -= 1;
                b += 1;
                res.push_back("B");
           }
           else{ // covers a < b and a == b and a != 1.
           		a += 1;
                b -= 1;
                res.push_back("A");
           }
        }
         	if(events[i] == "BC"){
        	if(b == 0 and c == 0){
            	possible = false;
                break;
            }
            else if(b == 1 and c == 1 and a = 0 and i != n and events[i + 1] == "AB"){
            	a -= 1;
                b += 1;
                res.push_back("B");
            }
            else if(b == 1 and c == 1  and a = 0 and i != n and events[i + 1] == "AC"){
            	c += 1;
                b -= 1;
                res.push_back("C");
            }
           else if(b > c){
           		b -= 1;
                c += 1;
                res.push_back("C");
           }
           else{ // covers b < c and b == c and b != 1.
           		b += 1;
                c -= 1;
                res.push_back("B");
           }
        }
       	if(events[i] == "AC"){
        	if(a == 0 and c == 0){
            	possible = false;
                break;
            }
            else if(a == 1 and c == 1 and b == 0 and i != n and events[i + 1] == "BC"){
            	a -= 1;
                c += 1;
                res.push_back("C");
            }
            else if(a == 1 and c == 1 and b == 0 and i != n and events[i + 1] == "AB"){
                a += 1;
                c -= 1;
                res.push_back("A");
            }
           else if(a > c){
           		a -= 1;
                c += 1;
                res.push_back("C");
           }
           else{ // covers a < c and a == c and a != 1.
           		a += 1;
                c -= 1;
                res.push_back("A");
           }
        }
      
    }
  
  if(possible){
  	cout << "Yes" << endl;
    for(int i = 0; i < n; i++){
    	cout << res[i] << endl;
    }
  }
  else {
  	cout << "No" << endl;
  }
}



int main(){
	int n, a, b, c;
    cin >> n >> a >> b >> c;
    vector<string> events(n);
   	for(int i = 0; i < n; i++){
    	cin >> events[i];
    }
  
    solve(n, a, b, c, events);
  	
	return 0;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
	int64_t n, a, b, c;
	cin >> n >> a >> b >> c;
	vector<int64_t> count_sim = { a,b,c };
	vector<string> opt(n);
	for (int i = 0; i < n; i++) cin >> opt.at(i);
	vector<int> count_opt(3, 0);
	for (int i = 0; i < n; i++) {
		if (opt.at(i) == "AB") count_opt.at(0)++;
		else if (opt.at(i) == "AC") count_opt.at(1)++;
		else count_opt.at(2)++;
	}
	vector<int> opt_sim(6, 0);
	for (int i = 0; i < count_opt(0); i++) {
		if (count_sim.at(0) > 0) {
			opt_sim.at(0)++;
			count_sim.at(0)--;
			count_sim.at(1)++;
		}
		else if(count_sim.at(1)>0){
			opt_sim.at(1)++;
			count_sim.at(0)++;
			count_sim.at(1)--;
		}
		else {
			cout << "No" << endl;
			return 0;
		}
	}
	for (int i = 0; i < count_opt(1); i++) {
		if (count_sim.at(0) > 0) {
			opt_sim.at(2)++;
			count_sim.at(0)--;
			count_sim.at(2)++;
		}
		else if (count_sim.at(2) > 0) {
			opt_sim.at(3)++;
			count_sim.at(0)++;
			count_sim.at(2)--;
		}
		else {
			cout << "No" << endl;
			return 0;
		}
	}
	for (int i = 0; i < count_opt(2); i++) {
		if (count_sim.at(1) > 0) {
			opt_sim.at(4)++;
			count_sim.at(1)--;
			count_sim.at(2)++;
		}
		else if (count_sim.at(2) > 0) {
			opt_sim.at(5)++;
			count_sim.at(2)++;
			count_sim.at(1)--;
		}
		else {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	for (int i = 0; i < n; i++) {
		if(opt.at(i)=="AB"&&opt_sim.at(0)>0){
			cout << "A" << endl;
			opt_sim.at(0)--;
		}
		else if (opt.at(i) == "AB" && opt_sim.at(1) > 0) {
			cout << "B" << endl;
			opt_sim.at(1)--;
		}
		else if (opt.at(i) == "AC" && opt_sim.at(2) > 0) {
			cout << "A" << endl;
			opt_sim.at(2)--;
		}
		else if (opt.at(i) == "AC" && opt_sim.at(3) > 0) {
			cout << "A" << endl;
			opt_sim.at(3)--;
		}
		else if (opt.at(i) == "BA" && opt_sim.at(4) > 0) {
			cout << "A" << endl;
			opt_sim.at(4)--;
		}
		else if (opt.at(i) == "BA" && opt_sim.at(5) > 0) {
			cout << "A" << endl;
			opt_sim.at(5)--;
		}
		else {}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:38: error: no match for call to '(std::vector<int>) (int)'
   16 |         for (int i = 0; i < count_opt(0); i++) {
      |                             ~~~~~~~~~^~~
a.cc:32:38: error: no match for call to '(std::vector<int>) (int)'
   32 |         for (int i = 0; i < count_opt(1); i++) {
      |                             ~~~~~~~~~^~~
a.cc:48:38: error: no match for call to '(std::vector<int>) (int)'
   48 |         for (int i = 0; i < count_opt(2); i++) {
      |                             ~~~~~~~~~^~~
Language: C++

#include <iostream>

using namespace std;

int main(){
  int n, a, b, c;
  vector<string> seq;
  bool possible = true;
  cin >> n >> a >> b >> c;
  
  for(int i = 0; i < n; i++){
  	string s;
    cin >> s;
    if(s == "AB"){
    	if(a > b and a != 0){
        	a -= 1;
            b += 1;
            seq.push_back(b);
        }
        else if(a < b and b != 0){
        	a += 1;
            b -= 1;
            seq.push_back(a);
        }
        else if(a == b and a != 0) {
        	a +=1;
            b -=1;
            seq.push_back(a);
        }
        else{
        	cout << "No" << endl;
            possible = false;
            break;
        }
    }
    else if(s == "AC"){
    	if(a > c and a != 0){
        	a -= 1;
            c += 1;
            seq.push_back(c);
        }
        else if(a < c and c != 0){
        	a += 1;
            c -= 1;
            seq.push_back(a);
        }
        else if(a == c and a != 0) {
        	a +=1;
            c -=1;
            seq.push_back(a);
        }
        else{
        	cout << "No" << endl;
            possible = false;
            break;
        }
    }
    else{
    	if(b > c and b != 0){
        	b -= 1;
            c += 1;
            seq.push_back(c);
        }
        else if(b < c and c != 0){
        	b += 1;
            c -= 1;
            seq.push_back(b);
        }
        else if(b == c and b != 0) {
        	b +=1;
            c -=1;
            seq.push_back(b);
        }
        else{
        	cout << "No" << endl;
            possible = false;
            break;
        }
    }
  }
  
  if(possible){
  	cout << "Yes" << endl;
    
    for(int i = 0; i < seq.size(); i++){
    	cout << seq[i] << endl;
    }
  }
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<string> seq;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:7:16: error: expected primary-expression before '>' token
    7 |   vector<string> seq;
      |                ^
a.cc:7:18: error: 'seq' was not declared in this scope
    7 |   vector<string> seq;
      |                  ^~~
Language: C++

//
// Created by bytedance on 2020/5/6.
//
#include <iostream>
#include <vector>

using namespace std;
const int maxn = 1e5 + 5;
char shit[maxn][5];

int main() {
    int n, a, b, c;
    scanf("%d%d%d%d", &n, &a, &b, &c);
    vector<char> ans;
    for (int i = 0; i < n; i++) {
        scanf("%s", shit[i]);
    }
    for (int i = 0; i < n; i++) {
        int *t1, *t2;
        if (strcmp(shit[i], "AB") == 0) {
            t1 = &a;
            t2 = &b;
        } else if (strcmp(shit[i], "AC") == 0) {
            t1 = &a;
            t2 = &c;
        } else if (strcmp(shit[i], "BC") == 0) {
            t1 = &b;
            t2 = &c;
        } else {
            while (1);
        }
        if (*t1 != *t2) {
            if (*t1 > *t2) {
                (*t1)--;
                (*t2)++;
                ans.push_back(shit[i][1]);
            } else {
                (*t2)--;
                (*t1)++;
                ans.push_back(shit[i][0]);

            }
        } else {
            if (*t1 == 0) {
                printf("No\n");
                return 0;
            } else if (*t1 == 1) {
                if (i == n - 1 || (shit[i][0] == shit[i + 1][0] || shit[i][0] == shit[i + 1][1])) {
                    (*t1)++;
                    (*t2)--;
                    ans.push_back(shit[i][0]);
                } else {
                    (*t1)--;
                    (*t2)++;
                    ans.push_back(shit[i][1]);
                }
            } else {
                (*t1)++;
                (*t2)--;
                ans.push_back(shit[i][0]);
            }
        }
    }
    printf("Yes\n");
    for (int i = 0; i < n; i++) {
        printf("%c\n", ans[i]);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'strcmp' was not declared in this scope
   20 |         if (strcmp(shit[i], "AB") == 0) {
      |             ^~~~~~
a.cc:6:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <vector>
  +++ |+#include <cstring>
    6 |
Language: C++

#include "bits/stdc++.h"
using p = pair<int, int>;
using namespace std;

int main() {
	int n, ko_do;
	vector<int> d(3);
	cin >> n >> d[0] >> d[1] >> d[2];
	vector<p> q;
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		int a = 0, b = 1;
		if (s == "AB") a = 0, b = 1;
		if (s == "AC") a = 0; b = 2;
		if (s == "BC") a = 1, b = 2;
		q.emplace_back(a, b);
	}
	string ans;
	auto add = [&](int a, int b) {
		d[a]++;
		d[b]--;
		ans += "A" + a;
	};

	q.emplace_back(0, 1);
	for (int i = 0; i < n; i++) {
		int a = q[i].first;
		int b = q[i].second;
		if (d[a] == 0 && d[b] == 0) {
			cout << "NO" << endl;
			return 0;
		}
		if(d[a] == 0){
			add(a, b);
		}
		else if (d[b] == 0) {
			add(a, b);
		}
		else {
			int na = q[i + 1].first;
			int nb = q[i + 1].second;
			if (a == na || a == nb) {
				add(a, b);
			}
			else {
				add(b, a);
			}
		}
	}
	cout << "YES" << endl;
	for (int i = 0; i < n; i++)
	    cout << ans[i] << endl;
	return 0;
}

Compiler output:
a.cc:2:11: error: 'pair' does not name a type
    2 | using p = pair<int, int>;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:9:16: error: 'p' was not declared in this scope
    9 |         vector<p> q;
      |                ^
a.cc:9:17: error: template argument 1 is invalid
    9 |         vector<p> q;
      |                 ^
a.cc:9:17: error: template argument 2 is invalid
a.cc:17:19: error: request for member 'emplace_back' in 'q', which is of non-class type 'int'
   17 |                 q.emplace_back(a, b);
      |                   ^~~~~~~~~~~~
a.cc:26:11: error: request for member 'emplace_back' in 'q', which is of non-class type 'int'
   26 |         q.emplace_back(0, 1);
      |           ^~~~~~~~~~~~
a.cc:28:26: error: invalid types 'int[int]' for array subscript
   28 |                 int a = q[i].first;
      |                          ^
a.cc:29:26: error: invalid types 'int[int]' for array subscript
   29 |                 int b = q[i].second;
      |                          ^
a.cc:41:35: error: invalid types 'int[int]' for array subscript
   41 |                         int na = q[i + 1].first;
      |                                   ^
a.cc:42:35: error: invalid types 'int[int]' for array subscript
   42 |                         int nb = q[i + 1].second;
      |                                   ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)


bool solution(vector<int>& num, vector<string>& s, vector<char>& ans){
    REP(i, s.size()){
        // 選ばれているものを数字に変換
        int i1 = s[i][0] - 'A';
        int i2 = s[i][1] - 'A';
        int large = i1, small = i2;  // 一般的にはどっちを選んでも良い

        if(num[i1]+num[i2] == 0) return false;
        else if(num[i1] == 1 and num[i2] == 1){
            if(i+1 < N and (s[i+1][0] == s[i][0] or s[i+1][1] == s[i][0])){
                small = i1;
                large = i2;
            }
        }else if(num[i1] < num[i2]){  // 基本的には大きい方から小さい方に持っていく
            small = i1;
            large = i2;
        }
        ans.push_back(small+'A');
        ++num[small];
        --num[large];
    }
    return true;
}

int main()
{
    int N;
    vector<int> num(3);
    cin >> N >> num[0] >> num[1] >> num[2];
    vector<string> s(N);
    REP(i, N) cin >> s[i];

    vector<char> ans;
    if(solution(num, s, ans)){
        cout << "Yes" << endl;
        for(auto c: ans) cout << c << endl;
    }else cout << "No" << endl;

    return 0;
}

Compiler output:
a.cc: In function 'bool solution(std::vector<int>&, std::vector<std::__cxx11::basic_string<char> >&, std::vector<char>&)':
a.cc:20:22: error: 'N' was not declared in this scope
   20 |             if(i+1 < N and (s[i+1][0] == s[i][0] or s[i+1][1] == s[i][0])){
      |                      ^
Language: C++

#include<iostream>
#include<queue>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
using namespace std;
/****************************/
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define vpii vector<pair<int,int> >
#define qi queue<int>
#define mii map<int,int>
#define msi map<string,int>
#define vs vector<string>
#define vc vector<char>
/****************************/
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep2(i,n) for(ll i=(n)-1;i>=0;i--)
#define rep3(i,a,n) for(ll i=(a);i<(n);i++)
#define rep4(i,a,n) for(ll i=(a)-1;i>=n;i--)
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define pi 3.1415926535897932384626433832795
#define zero(n) memset(n,0,sizeof(n));
#define SZ(n) n.size()
#define sn st.nd 
ll dx[4]={0,-1,0,1};
ll dy[4]={1,0,-1,0};
/****************************/
ll n,a,b,c;
string s[100010];
inline void die()
{
	cout<<"No";
	exit(0);
}
int main()
{
	ios::sync_with_stdio(0);
	cin>>n>>a>>b>>c;
	rep(i,n)
	{
		cin>>s[i];
	}
	int d=0;
	if(a==0)
	d++;
	if(b==0)
	d++;
	if(c==0)
	d++;
	if(d>=2){
		cout<<"No";
		re 0;
	}
	vc ans;
	rep(i,n)
	{
		if(s[i]=="AB")
		{
			if(a>b)
			{
				a--,b++;
				ans.pb('B');
			}
			else
			{
				ans.pb('A');
				b--,a++;
			}
			if(a<0||b<0) die;
		}
		if(s[i]=="BC")
		{
			if(b>c)
			{
				ans.pb('C');
				b--,c++;
			}
			else
			{
				ans.pb('B');
				c--,b++;
			}
			if(b<0||c<0) die;
		}
		if(s[i]=="AC")
		{
			if(a>c)
			{
				a--,c++;
				ans.pb('C');
			}
			else
			{
				ans.pb('A');
				c--,a++;
			}
			if(a<0||c<0) die;
		}
	}
	cout<<"Yes"<<endl;
	rep(i,ans.size())
	{
		cout<<ans[i]<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:17: error: 're' was not declared in this scope; did you mean 'rep'?
   69 |                 re 0;
      |                 ^~
      |                 rep
Language: C++

#include<iostream>
#include<queue>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
using namespace std;
/****************************/
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define vpii vector<pair<int,int> >
#define qi queue<int>
#define mii map<int,int>
#define msi map<string,int>
#define vs vector<string>
#define vc vector<char>
/****************************/
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep2(i,n) for(ll i=(n)-1;i>=0;i--)
#define rep3(i,a,n) for(ll i=(a);i<(n);i++)
#define rep4(i,a,n) for(ll i=(a)-1;i>=n;i--)
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define pi 3.1415926535897932384626433832795
#define zero(n) memset(n,0,sizeof(n));
#define SZ(n) n.size()
#define sn st.nd 
ll dx[4]={0,-1,0,1};
ll dy[4]={1,0,-1,0};
/****************************/
ll n,a,b,c;
string s[100010];
inline void die()
{
	cout<<"No";
	exit(0);
}
int main()
{
	ios::sync_with_stdio(0);
	cin>>n>>a>>b>>c;
	rep(i,n)
	{
		cin>>s[i];
	}
	rep(i,n)
	cin>>s[i];
	int d=0;
	if(a[0]==0)
	d++;
	if(a[1]==0)
	d++;
	if(a[2]==0)
	d++;
	if(d>=2){
		cout<<"No";
		re 0;
	}
	vc ans;
	rep(i,n)
	{
		if(s[i]=="AB")
		{
			if(a>b)
			{
				a--,b++;
				ans.pb('B');
			}
			else
			{
				ans.pb('A');
				b--,a++;
			}
			if(a<0||b<0) die;
		}
		if(s[i]=="BC")
		{
			if(b>c)
			{
				ans.pb('C');
				b--,c++;
			}
			else
			{
				ans.pb('B');
				c--,b++;
			}
			if(b<0||c<0) die;
		}
		if(s[i]=="AC")
		{
			if(a>c)
			{
				a--,c++;
				ans.pb('C');
			}
			else
			{
				ans.pb('A');
				c--,a++;
			}
			if(a<0||c<0) die;
		}
	}
	cout<<"Yes"<<endl;
	rep(i,ans.size())
	{
		cout<<ans[i]<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:13: error: invalid types 'long long int[int]' for array subscript
   63 |         if(a[0]==0)
      |             ^
a.cc:65:13: error: invalid types 'long long int[int]' for array subscript
   65 |         if(a[1]==0)
      |             ^
a.cc:67:13: error: invalid types 'long long int[int]' for array subscript
   67 |         if(a[2]==0)
      |             ^
a.cc:71:17: error: 're' was not declared in this scope; did you mean 'rep'?
   71 |                 re 0;
      |                 ^~
      |                 rep
Language: C

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;

#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, m, n) for(int i = (int)(m); i < (int)(n); ++i)


string numToChar(int num){
    if(num == 0) return "A";
    else if(num == 1) return "B";
    else return "C";
}

int main()
{
    int N;
    vector<int> num(3);
    cin >> N >> num[0] >> num[1] >> num[2];
    vector<string> s(N);
    REP(i, N) cin >> s[i];

    vector<char> ans;
    long long S = accumulate(num.begin(), num.end(), (long long) 0);
    if(S == 0){
        cout << "No" << endl;
        return 0;
    }
    REP(i, N){
        int c1 = s[i][0] - 'A';
        int c2 = s[i][1] - 'A';
        int c3 = 3-c1-c2;
        if(S == 1){
            if(num[c1]+num[c2] == 0){
                cout << "No" << endl;
                return 0;
            }else{
                int small = (num[c1] > num[c2])? c2: c1;
                int large = (num[c1] > num[c2])? c1: c2;
                ans.push_back(small);
                ++num[small];
                --num[large];
            }
        }else{
            if(c1 == 0){
                ans.push_back(s[i][0]);
                ++num[c1];
                --num[c2];
                continue;
            }
            if(c2 == 0){
                ans.push_back(s[i][1]);
                --num[c1];
                ++num[c2];
                continue;
            }
            if(i+1 < N and c1 == 1 and c3 == 0 and s[i+1] == numToChar(c1)+numToChar(c3)){
                ans.push_back(s[i][0]);
                ++num[c1];
                --num[c2];
                continue;
            }
            if(i+1 < N and c2 == 1 and c3 == 0 and s[i+1] == numToChar(c2)+numToChar(c3)){
                ans.push_back(s[i][1]);
                --num[c1];
                ++num[c2];
                continue;
            }
            cout << s[i][0] << endl;
            ++num[c1];
            --num[c2];
        }
    }
    for(auto c: ans) cout << c << endl;

    return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
 long int n,a,b,c;
  cin>>n>>a>>b>>c;
  string s;
  int x[2]={0};
  while(n--)
  {
     cin>>s;
     for(int i=0;i<2;i++)
     {
       if(s[i]=='A')x[i]=a;
       if(s[i]=='B')x[i]=b;
        if(s[i]=='C')x[i]=c;
     }
  
    
     if(x[0]<x[1]){x[0]++;x[1]--;}
     else {x[0]--;x[1]++;}
       
     if(x[0]>=0&&x[1]>=0)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^