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

#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,no-stack-protector,fast-math")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define IO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
const int N = 4e5 + 5, M = 2 * N + 5;

int n, a[N], b[N];

int took[N];
char s[N][3];
bool done[3][3];

vector<char> out;
vector<pair<int, int> > seq;

bool ok[N];

vector<char> fin;
vector<pair<int, int> > nw;

int idx[3];

int getIdx(int i){
    if(s[i][0] == 'A' && s[i][1] == 'B')return 0;
    if(s[i][0] == 'A' && s[i][1] == 'C')return 1;
    return 2;
}

bool check(vector<int> st){
    int fen = 0;
    fin.clear();

    memset(idx, 0, sizeof idx);
    memcpy(b, a, 3 * sizeof a[0]);

//    cout << "---------------" << endl;
//    for(int i = 0 ; i < 3 ; ++i)cout << b[i] << " "; cout << endl;
//    cout << "---------------" << endl;

    for(int i = 0 ; i < n ; ++i){
        if(ok[i] == true){
            int x = nw[fen].first;
            int y = nw[fen++].second;

            b[s[i][0] - 'A'] += x;
            b[s[i][1] - 'A'] += y;

            if(b[s[i][0] - 'A'] >= 0 && b[s[i][1] - 'A'] >= 0)
                fin.emplace_back(x == 1 ? s[i][0] : s[i][1]);
            else return false;

            continue;
        }

        int I = getIdx(i);

        if(idx[I] % 2 == st[I]){
            b[s[i][0] - 'A'] += 1;
            b[s[i][1] - 'A'] -= 1;

            if(b[s[i][0] - 'A'] >= 0 && b[s[i][1] - 'A'] >= 0)
                fin.emplace_back(s[i][0]);
            else return false;
        }
        else{
            b[s[i][0] - 'A'] -= 1;
            b[s[i][1] - 'A'] += 1;

            if(b[s[i][0] - 'A'] >= 0 && b[s[i][1] - 'A'] >= 0)
                fin.emplace_back(s[i][1]);
            else return false;
        }
        ++idx[I];
    }
//    for(int i = 0 ; i < 3 ; ++i)cout << b[i] << " "; cout << endl;
    return true;
}

vector<char> check(){
    for(int A = 0 ; A < 2 ; ++A){
        for(int B = 0 ; B < 2 ; ++B){
            for(int C = 0 ; C < 2 ; ++C){
                if(check({A, B, C}))return fin;
            }
        }
    }
    return vector<char>();
}

void print(vector<char> out){
    puts("Yes");
    for(auto i : out)printf("%c\n", i);
    exit(0);
}


void f(int i){
    if(i == seq.size()){
        auto ret = check();
        if(ret.empty())return;
        print(ret);
    }
    nw.emplace_back(-1, 1);
    f(i + 1);
    nw.pop_back();
    nw.emplace_back(1, -1);
    f(i + 1);
    nw.pop_back();
}

int main(){
    scanf("%d", &n);
    for(int i = 0 ; i < 3 ; ++i)
        scanf("%d", a + i);

    for(int i = 0 ; i < n ; ++i){
        scanf("%s", s + i);
        int x = s[i][0] - 'A';
        int y = s[i][1] - 'A';
        if(done[x][y] < 2)
            ++done[x][y], ok[i] = true, seq.emplace_back(x, y);
    }

    f(0);

    puts("No");

}

Compiler output:
a.cc: In function 'int main()':
a.cc:123:24: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
  123 |             ++done[x][y], ok[i] = true, seq.emplace_back(x, y);
      |               ~~~~~~~~~^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

int N, A, B, C, hoji1, hoji2;

vector<string> S(110000);
vector<int> values(3);
vector<string> ans(110000);
bool flag = true;

void calc(string s,int i){

}

void hantei(int a, int b, string A, string B, int i)
{
    hoji1 = values[a];
    hoji2 = values[b];
    values[a] += -1;
    values[b] += 1;
    calc(S[i + 1], i + 1);
    ans[i] = A;
    if (flag == false)
    {
        values[a] = hoji1;
        values[b] = hoji2;
        values[a] += 1;
        values[b] += -1;
        flag = true;
        ans[i] = B;
    }
}

void calc(string s, int i)
{
    if (s == "AB")
    {
        if (values[0] > values[1])
        {
            values[0] += -1;
            values[1] += 1;
            ans[i] = "B";
        }
        else if (values[0] < values[1])
        {
            values[0] += 1;
            values[1] += -1;
            ans[i] = "A";
        }
        else
        {
            hantei(0,1,"B","A",i);
        }
    }
    if (s == "BC")
    {
        if (values[1] > values[2])
        {
            values[1] += -1;
            values[2] += 1;
            ans[i] = "C";
        }
        else if (values[1] < values[2])
        {
            values[1] += 1;
            values[2] += -1;
            ans[i] = "B";
        }
        else
        {
            hantei(1,2,"C","B",i);
        }
    }
    if (s == "AC")
    {
        if (values[0] > values[2])
        {
            values[0] += -1;
            values[2] += 1;
            ans[i] = "C";
        }
        else if (values[0] < values[2])
        {
            values[0] += 1;
            values[2] += -1;
            ans[i] = "A";
        }
        else
        {
            hantei(0,2,"C","A",i);
        }
    }
    rep(i, 3)
    {
        if (values[i] < 0 && flag == true)
        {
            flag = false;
            break;
        }
    }
}

int main()
{
    cin >> N >> A >> B >> C;
    values = {A, B, C};
    int sum = values[0] + values[1] + values[2];
    rep(i, N)
    {
        cin >> S[i];
    }

    rep(i, N)
    {
        calc(S[i], i);
    }
    if (flag)
    {
        cout << "Yes" << endl;
        rep(i, N)
        {
            cout << ans[i] << endl;
        }
    }
    else
    {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc:35:6: error: redefinition of 'void calc(std::string, int)'
   35 | void calc(string s, int i)
      |      ^~~~
a.cc:12:6: note: 'void calc(std::string, int)' previously defined here
   12 | void calc(string s,int i){
      |      ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

int N, A, B, C, hoji1, hoji2;

vector<string> S(110000);
vector<int> values(3);
vector<string> ans(110000);
bool flag = true;

void calc(){
    
}

void hantei(int a, int b, string A, string B, int i)
{
    hoji1 = values[a];
    hoji2 = values[b];
    values[a] += -1;
    values[b] += 1;
    calc(S[i + 1], i + 1);
    ans[i] = A;
    if (flag == false)
    {
        values[a] = hoji1;
        values[b] = hoji2;
        values[a] += 1;
        values[b] += -1;
        flag = true;
        ans[i] = B;
    }
}

void calc(string s, int i)
{
    if (s == "AB")
    {
        if (values[0] > values[1])
        {
            values[0] += -1;
            values[1] += 1;
            ans[i] = "B";
        }
        else if (values[0] < values[1])
        {
            values[0] += 1;
            values[1] += -1;
            ans[i] = "A";
        }
        else
        {
            hantei(0,1,"B","A",i);
        }
    }
    if (s == "BC")
    {
        if (values[1] > values[2])
        {
            values[1] += -1;
            values[2] += 1;
            ans[i] = "C";
        }
        else if (values[1] < values[2])
        {
            values[1] += 1;
            values[2] += -1;
            ans[i] = "B";
        }
        else
        {
            hantei(1,2,"C","B",i);
        }
    }
    if (s == "AC")
    {
        if (values[0] > values[2])
        {
            values[0] += -1;
            values[2] += 1;
            ans[i] = "C";
        }
        else if (values[0] < values[2])
        {
            values[0] += 1;
            values[2] += -1;
            ans[i] = "A";
        }
        else
        {
            hantei(0,2,"C","A",i);
        }
    }
    rep(i, 3)
    {
        if (values[i] < 0 && flag == true)
        {
            flag = false;
            break;
        }
    }
}

int main()
{
    cin >> N >> A >> B >> C;
    values = {A, B, C};
    int sum = values[0] + values[1] + values[2];
    rep(i, N)
    {
        cin >> S[i];
    }

    rep(i, N)
    {
        calc(S[i], i);
    }
    if (flag)
    {
        cout << "Yes" << endl;
        rep(i, N)
        {
            cout << ans[i] << endl;
        }
    }
    else
    {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'void hantei(int, int, std::string, std::string, int)':
a.cc:22:9: error: too many arguments to function 'void calc()'
   22 |     calc(S[i + 1], i + 1);
      |     ~~~~^~~~~~~~~~~~~~~~~
a.cc:12:6: note: declared here
   12 | void calc(){
      |      ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

int N, A, B, C, hoji1, hoji2;

vector<string> S(110000);
vector<int> values(3);
vector<string> ans(110000);
bool flag = true;

void hantei(int a, int b, string A, string B, int i)
{
    hoji1 = values[a];
    hoji2 = values[b];
    values[a] += -1;
    values[b] += 1;
    calc(S[i + 1], i + 1);
    ans[i] = A;
    if (flag == false)
    {
        values[a] = hoji1;
        values[b] = hoji2;
        values[a] += 1;
        values[b] += -1;
        flag = true;
        ans[i] = B;
    }
}

void calc(string s, int i)
{
    if (s == "AB")
    {
        if (values[0] > values[1])
        {
            values[0] += -1;
            values[1] += 1;
            ans[i] = "B";
        }
        else if (values[0] < values[1])
        {
            values[0] += 1;
            values[1] += -1;
            ans[i] = "A";
        }
        else
        {
            hantei(0,1,"B","A",i);
        }
    }
    if (s == "BC")
    {
        if (values[1] > values[2])
        {
            values[1] += -1;
            values[2] += 1;
            ans[i] = "C";
        }
        else if (values[1] < values[2])
        {
            values[1] += 1;
            values[2] += -1;
            ans[i] = "B";
        }
        else
        {
            hantei(1,2,"C","B",i);
        }
    }
    if (s == "AC")
    {
        if (values[0] > values[2])
        {
            values[0] += -1;
            values[2] += 1;
            ans[i] = "C";
        }
        else if (values[0] < values[2])
        {
            values[0] += 1;
            values[2] += -1;
            ans[i] = "A";
        }
        else
        {
            hantei(0,2,"C","A",i);
        }
    }
    rep(i, 3)
    {
        if (values[i] < 0 && flag == true)
        {
            flag = false;
            break;
        }
    }
}

int main()
{
    cin >> N >> A >> B >> C;
    values = {A, B, C};
    int sum = values[0] + values[1] + values[2];
    rep(i, N)
    {
        cin >> S[i];
    }

    rep(i, N)
    {
        calc(S[i], i);
    }
    if (flag)
    {
        cout << "Yes" << endl;
        rep(i, N)
        {
            cout << ans[i] << endl;
        }
    }
    else
    {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'void hantei(int, int, std::string, std::string, int)':
a.cc:18:5: error: 'calc' was not declared in this scope
   18 |     calc(S[i + 1], i + 1);
      |     ^~~~
Language: C++

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

	return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

ll dist(ll x, ll y, ll xx, ll yy) {
  return abs(x-xx)+abs(y-yy);
}

int main() {
  int n;
  vector<int> vals(3, 0);
  cin >> n;
  ll S = 0;
  for(int i = 0; i < 3; i++) {
    cin >> vals[i];
    S += vals[i];
  }
  ll xc = 3*S/2;
  ll yc = 3*S/2;
  
  vector<char> moves;
  ll& x = vals[0];
  ll& y = vals[1];
  for(int i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (s == "AB") {
      ll x1 = x+1; // a++
      ll y1 = y-1;
      ll z1 = S-x1-y1;
      ll x2 = x-1; // b++
      ll y2 = y+1;
      ll z2 = S-x2-y2;
      if (x1 < 0 || y1 < 0 || z1 < 0) {
        y++;
        x--;
        moves.push_back('B');
      } else if (x2 < 0 || y2 < 0 || z2 < 0) {
        x++;
        y--;
        moves.push_back('A');
      } else if (dist(xc, yc, x1, y1) < dist(xc, yc, x2, y2)) {
        x++;
        y--;
        moves.push_back('A');
      } else {
        x--;
        y++;
        moves.push_back('B');
      }
    } else if(s == "AC") {
      
      ll x1 = x+1; // a++
      ll y1 = y;
      ll z1 = S-x1-y1;
      ll x2 = x-1; // c++
      ll y2 = y;
      ll z2 = S-x2-y2;
      if (x1 < 0 || y1 < 0 || z1 < 0) {
        x--;
        moves.push_back('C');
      } else if (x2 < 0 || y2 < 0 || z2 < 0) {
        x++;
        moves.push_back('A');
      } else if (dist(xc, yc, x1, y1) < dist(xc, yc, x2, y2)) {
        x++;
        moves.push_back('A');
      } else {
        x--;
        moves.push_back('C');
      }
    } else {
      ll x1 = x; // b++
      ll y1 = y+1;
      ll z1 = S-x1-y1;
      ll x2 = x; // c++
      ll y2 = y-1;
      ll z2 = S-x2-y2;
      if (x1 < 0 || y1 < 0 || z1 < 0) {
        y--;
        moves.push_back('C');
      } else if (x2 < 0 || y2 < 0 || z2 < 0) {
        y++;
        moves.push_back('B');
      } else if (dist(xc, yc, x1, y1) < dist(xc, yc, x2, y2)) {
        y++;
        moves.push_back('B');
      } else {
        y--;
        moves.push_back('C');
      }
    }
    if (x < 0 || y < 0 || (S-x-y) < 0) {
      cout << "No" << endl;
      exit(0);
    }
  }
  cout << "Yes" << endl;
  for(char c : moves) cout << c << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: cannot bind non-const lvalue reference of type 'll&' {aka 'long long int&'} to a value of type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   22 |   ll& x = vals[0];
      |                 ^
a.cc:23:17: error: cannot bind non-const lvalue reference of type 'll&' {aka 'long long int&'} to a value of type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   23 |   ll& y = vals[1];
      |                 ^
Language: C++

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

int main() {
  int n;
  vector<int> vals(3, 0);
  cin >> n;
  for(int i = 0; i < 3; i++) cin >> vals[i];
  
  vector<char> moves;
  for(int i = 0; i < n; i++) {
    stirng s;
    cin >> s;
    int u = s[0]-'A';
    int v = s[1]-'A';
    if (vals[u] == 0 && vals[v] == 0) {
      cout << "No" << endl;
      exit(0);
    }
    if (vals[u] < vals[v]) {
      vals[u]++;
      vals[v]--;
      moves.push_back('A'+u);
    } else {
      vals[u]--;
      vals[v]++;
      moves.push_back('A'+v);
    }
  }
  cout << "Yes" << endl;
  for(char c : moves) cout << c << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'stirng' was not declared in this scope
   12 |     stirng s;
      |     ^~~~~~
a.cc:13:12: error: 's' was not declared in this scope
   13 |     cin >> s;
      |            ^
Language: C

#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;

void printCmd(vi &ans) {
  cout << "Yes" << endl;
  for(int c:ans) {
    string s = "";
    s += c+'A';
    cout << s << endl;
  }
}
  
int main() {
  int N;
  cin >> N;
  vl st(3);
  rep(i,3) {
    cin >> st[i];
  }
  vi cmd(N);
  rep(i,N) {
    string s;
    cin >> s;
    if(s=="AB") {
      cmd[i]=0;
    } else if(s=="BC") {
      cmd[i]=1;
    } else {
      cmd[i]=2;
    }
  }
  vi ans;
  bool ok=true;
  vl now(st);
  auto calc = [&](int x,int y,int i) {
    if(now[x]>st[x]&&st[x]>0) {
      ans.push_back(y);
      now[x]--;
      now[y]++;
    } else if(now[y]>st[y]&&st[y]>0) {
      ans.push_back(x);
      now[y]--;
      now[x]++;
    } else {
      if(i==N-1) {
        if(now[y]>0) {
          ans.push_back(x);
          now[y]--;
          now[x]++;
        } else if(now[x]>0) {
          ans.push_back(y);
          now[x]--;
          now[y]++;
        } else {
          ok=false;
        }
      } else {
        if(now[x]==0) {
          ans.push_back(x);
          now[x]++;
          now[y]--;
          if(now[y]<0) {
            ok=false;
          }
        } else if(now[y]==0) {
          ans.push_back(y);
          now[y]++;
          now[x]--;
          if(now[x]<0) {
            ok=false;
          }
        } else if(cmd[i+1]==y||cmd[i+1]==(y+2)%3) {
          ans.push_back(y);
          now[x]--;
          now[y]++;
          if(now[x]<0) {
            ok=false;
          }
        } else {
          ans.push_back(x);
          now[y]--;
          now[x]++;
          if(now[y]<0) {
            ok=false;
          }
        }
      }
    }
  };
  
  rep(i,N) {
    if(!ok) break;
    switch (cmd[i])
    {
    case 0:
      calc(0,1,i);
      break;
    case 1:
      calc(1,2,i);
      break;
    case 2:
      calc(2,0,i);
      break;
    }
  }
  if(!ok) {
    cout << "No" << endl;
    return 0;
  }
  printCmd(ans);
  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;
typedef long long ll;
int main(){
    ll N,A,B,C;cin >> N >> A >> B >> C;
    vector<string> s(N);
    for(int i =0;i <N;i++) cin >> s[i];
    string ansS;
    for(int i = 0; i <N;i++){
        if (s[i] == "AB"){
            if (A == 0 && B == 0) break;
            if (A == 1 && B == 1 && C == 0){
                if (i != N - 1){
                    if (s[i + 1] == "AC"){
                        A++;B--;
                        ansS.push_back('A');
                        continue;
                    }
                    else if (s[i + 1] == "BC") {
                        A--;B++;
                        ansS.push_back('B');
                        continue;
                    }
                }
            }
            if (A >= B){
                A--;B++;
                ansS.push_back('B');

            }
            else{
                A++;B--;
                ansS.push_back('A');
            }
        }
        else if (s[i] == "AC"){
            if (A == 0 && C == 0) break;
            if (A == 1 && B == 0 && C == 1){
                if (i != N-1){
                    if (s[i + 1] == "AB"){
                        A++;C--;
                        ansS.push_back('A');
                        continue;
                    }
                    else if (s[i + 1] == "BC"){
                        A--;C++;
                        ansS.push_back('C');
                        continue;
                    }
                }
            }
            if (A >= C){
                A--;C++;
                ansS.push_back('C');
            }
            else{
                A++;C--;
                ansS.push_back('A');
            }
        }
        else if (s[i] == "BC"){
            if (B == 0 && C == 0) break;
            if (A == 0 && B == 1 && C == 1){
                if (i != N - 1){
                    if (s[i + 1] == "AB"){
                        B++;C--;
                        ansS.push_back('B');
                        continue;
                    }
                    else if (s[i + 1] == "AC"){
                        B--;C++;
                        ansS.push_back('C');
                        continue;
                    }
                }
            }
            if (B >= C){
                B--;C++;
                ansS.push_back('C');
            }
            else{
                B++;C--;
                ansS.push_back('B');
            }
        }
    }
    if (ansS.size() != N) cout << "No" << endl;
    else{
        cout << "Yes" << endl;
        REP(i, N) cout << ansS[i] << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:90:13: error: 'i' was not declared in this scope
   90 |         REP(i, N) cout << ansS[i] << endl;
      |             ^
a.cc:90:9: error: 'REP' was not declared in this scope
   90 |         REP(i, N) cout << ansS[i] << endl;
      |         ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll N,A,B,C;cin >> N >> A >> B >> C;
    vector<string> s(N);
    REP(i, N) cin >> s[i];
    string ansS;
    for(int i = 0; i <N;i++){
        if (s[i] == "AB"){
            if (A == 0 && B == 0) break;
            if (A == 1 && B == 1 && C == 0){
                if (i != N - 1){
                    if (s[i + 1] == "AC"){
                        A++;B--;
                        ansS.push_back('A');
                        continue;
                    }
                    else if (s[i + 1] == "BC") {
                        A--;B++;
                        ansS.push_back('B');
                        continue;
                    }
                }
            }
            if (A >= B){
                A--;B++;
                ansS.push_back('B');

            }
            else{
                A++;B--;
                ansS.push_back('A');
            }
        }
        else if (s[i] == "AC"){
            if (A == 0 && C == 0) break;
            if (A == 1 && B == 0 && C == 1){
                if (i != N-1){
                    if (s[i + 1] == "AB"){
                        A++;C--;
                        ansS.push_back('A');
                        continue;
                    }
                    else if (s[i + 1] == "BC"){
                        A--;C++;
                        ansS.push_back('C');
                        continue;
                    }
                }
            }
            if (A >= C){
                A--;C++;
                ansS.push_back('C');
            }
            else{
                A++;C--;
                ansS.push_back('A');
            }
        }
        else if (s[i] == "BC"){
            if (B == 0 && C == 0) break;
            if (A == 0 && B == 1 && C == 1){
                if (i != N - 1){
                    if (s[i + 1] == "AB"){
                        B++;C--;
                        ansS.push_back('B');
                        continue;
                    }
                    else if (s[i + 1] == "AC"){
                        B--;C++;
                        ansS.push_back('C');
                        continue;
                    }
                }
            }
            if (B >= C){
                B--;C++;
                ansS.push_back('C');
            }
            else{
                B++;C--;
                ansS.push_back('B');
            }
        }
    }
    if (ansS.size() != N) cout << "No" << endl;
    else{
        cout << "Yes" << endl;
        REP(i, N) cout << ansS[i] << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     REP(i, N) cin >> s[i];
      |         ^
a.cc:7:5: error: 'REP' was not declared in this scope
    7 |     REP(i, N) cin >> s[i];
      |     ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef pair<int,int> P;

#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<(b);i++)
#define repr(i,b,a) for(int i=int(b);i>=(a);i--)
#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool valid(int lx,int ux,int ly,int uy,int x,int y){
	return lx<=x&&x<ux&&ly<=y&&y<uy; 
}
ll power(ll x,ll p){
	if(p==0)return 1;
	ll res=power(x*x%mod,p/2);
	if(p%2==1)res=res*x%mod;
	return res;
}

bool isin(string s, char c){
	rep(i,s.size()){
		if(s[i]==c)return true;
	}
	return false;
}

int main()
{
	int n;
	vector<int> x(3);
	cin>>n;
	rep(i,3)cin>>x[i];
	vector<string> s(n);
	rep(i,n)cin>>s[i];

	vector<char> ans;
	rep(i,n){

		if(x[s[i][0]-'A']==0 && x[s[i][1]-'A']==0){
			cout<<"No"<<endl;
			return 0;
		}

		if(x[s[i][0]-'A'] < x[s[i][1]-'A']){
			x[s[i][0]-'A']++;
			x[s[i][1]-'A']--;
			ans.push_back(s[i][0]);
		}else if(x[s[i][0]-'A'] > x[s[i][1]-'A']){
			x[s[i][0]-'A']--;
			x[s[i][1]-'A']++;
			ans.push_back(s[i][1]);
		}else{
			if(i==n-1)ans.push_back(s[i][0]);
			else if(s[i+1]==s[i]){
				x[s[i][0]-'A']--;
				x[s[i][1]-'A']++;
				ans.push_back(s[i][1]);
			}else if(isin(s[i+1],s[i][0])){
				x[s[i][0]-'A']++;
				x[s[i][1]-'A']--;
				ans.push_back(s[i][0]);
			}else{
				x[s[i][0]-'A']--;
				x[s[i][1]-'A']++;
				ans.push_back(s[i][1);
			}
		}
	}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:74:53: error: expected ']' before ')' token
   74 |                                 ans.push_back(s[i][1);
      |                                                     ^
      |                                                     ]
Language: C++

#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e5 + 5;
char s[N][3];
int a[3], n;
int main() {
    scanf("%d%d%d%d", &n, &a[0], &a[1], &a[2]);
    for(int i = 0; i < n; i++) {
        scanf("%s", s[i]);
    }
    vector<char> ans;
    bool flag = true;
    for(int i = 0; i < n; i++) {
        int ta = s[i][0] - 'A', tb = s[i][1] - 'A';
        if(a[ta] > a[tb]) {
            ans.push_back(s[i][1]);
            a[tb]++, a[ta]--;
        }else if(a[tb] > a[ta]){
            ans.push_back(s[i][0]);
            a[ta]++, a[tb]--;
        }else {
            if(a[ta] == 0) {
                flag = false;
                break;
            }
            if(i + 1 >= n || s[i][0] == s[i + 1][0] || s[i][0] == s[i + 1][1]) {
                ans.push_back(s[i][0]);
                a[ta]++, a[tb]--;
            }else {
                ans.push_back(s[i][1]);
                a[tb]++, a[ta]--;
            }
        }
    }
    if(flag) {
        printf("Yes\n");
        for(int i = 0; i < n; i++) {
            printf("%c\n", ans[i]);
        }
    }else {
        printf("No\n");
    }
    return 0;
}

F.cpp

Compiler output:
a.cc:47:1: error: 'F' does not name a type
   47 | F.cpp
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int64_t N, A, B, C;
  cin >> N >> A >> B >> C;
  vector<string> S;
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    S.emplace_back(s);
  }
  int ab = 0, bc = 0, ac = 0;
  const vector<string> T = {"AB", "BC", "AC"};
  if (A > 1 && B > 1 && C > 1) {
    vector<char> res(N);
    for (int i = 0; i < N; i++) {
      if (S[i] == "AB") {
        res[i] = T[0][ab % 2];
        ab++;
      } else if (S[i] == "BC") {
        res[i] = T[1][bc % 2];
        bc++;
      } else {
        res[i] = T[2][ac % 2];
        ac++;
      }
    }
    for (int i = 0; i < N; i++) {
      cout << res[i] << '\n';
    }
  } else {
    dfs(A, B, C, 0);
    if (res.size() == 0) {
      cout << "No" << '\n';
    } else {
      cout << "Yes" << '\n';
      for (auto s : res) {
        cout << s << '\n';
      }
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:5: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   36 |     dfs(A, B, C, 0);
      |     ^~~
      |     ffs
a.cc:37:9: error: 'res' was not declared in this scope
   37 |     if (res.size() == 0) {
      |         ^~~
Language: C++

//https://www.hamayanhamayan.com/entry/2020/05/03/224516
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)

int N, A, B, C;
string S[101010];
//---------------------------------------------------------------------------------------------------
vector<char> ans;
bool dfs(int cu, int a, int b, int c) {
    if (cu == N) return true;

    if (S[cu] == "AB") {
        if (a == 0 && b == 0) return false;
        if (0 < a && dfs(cu + 1, a - 1, b + 1, c)) {
            ans.push_back('B');
            return true;
        }
        if (0 < b && dfs(cu + 1, a + 1, b - 1, c)) {
            ans.push_back('A');
            return true;
        }
        return false;
    }

    if (S[cu] == "AC") {
        if (a == 0 && c == 0) return false;
        if (0 < a && dfs(cu + 1, a - 1, b, c + 1)) {
            ans.push_back('C');
            return true;
        }
        if (0 < c && dfs(cu + 1, a + 1, b, c - 1)) {
            ans.push_back('A');
            return true;
        }
        return false;
    }

    if (S[cu] == "BC") {
        if (b == 0 && c == 0) return false;
        if (0 < b && dfs(cu + 1, a, b - 1, c + 1)) {
            ans.push_back('C');
            return true;
        }
        if (0 < c && dfs(cu + 1, a, b + 1, c - 1)) {
            ans.push_back('B');
            return true;
        }
        return false;
    }
}
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N >> A >> B >> C;
    rep(i, N) cin >> S[i];

    dfs(0, A, B, C);

    if (ans.size() == 0) cout << "No" << endl;
    else {
        printf("Yes\n");
        reverse(ans.begin(),ans.end());
        for(char c: ans) printf("%c\n", c);
    }
}

Compiler output:
a.cc: In function 'bool dfs(int, int, int, int)':
a.cc:55:1: warning: control reaches end of non-void function [-Wreturn-type]
   55 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

//https://www.hamayanhamayan.com/entry/2020/05/03/224516
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)

int N, A, B, C;
string S[101010];
//---------------------------------------------------------------------------------------------------
vector<char> ans;
bool dfs(int cu, int a, int b, int c) {
    if (cu == N) return true;

    if (S[cu] == "AB") {
        if (a == 0 && b == 0) return false;
        if (0 < a && dfs(cu + 1, a - 1, b + 1, c)) {
            ans.push_back('B');
            return true;
        }
        if (0 < b && dfs(cu + 1, a + 1, b - 1, c)) {
            ans.push_back('A');
            return true;
        }
        return false;
    }

    if (S[cu] == "AC") {
        if (a == 0 && c == 0) return false;
        if (0 < a && dfs(cu + 1, a - 1, b, c + 1)) {
            ans.push_back('C');
            return true;
        }
        if (0 < c && dfs(cu + 1, a + 1, b, c - 1)) {
            ans.push_back('A');
            return true;
        }
        return false;
    }

    if (S[cu] == "BC") {
        if (b == 0 && c == 0) return false;
        if (0 < b && dfs(cu + 1, a, b - 1, c + 1)) {
            ans.push_back('C');
            return true;
        }
        if (0 < c && dfs(cu + 1, a, b + 1, c - 1)) {
            ans.push_back('B');
            return true;
        }
        return false;
    }
}
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N >> A >> B >> C;
    rep(i, 0, N) cin >> S[i];

    dfs(0, A, B, C);

    if (ans.size() == 0) cout << "No" << endl;
    else {
        printf("Yes\n");
        reverse(ans.begin(),ans.end());
        for(char c: ans) printf("%c\n", c);
    }
}

Compiler output:
a.cc:59:16: error: macro "rep" passed 3 arguments, but takes just 2
   59 |     rep(i, 0, N) cin >> S[i];
      |                ^
a.cc:3:9: note: macro "rep" defined here
    3 | #define rep(i, n) for (int i = 0; i < (n); ++i)
      |         ^~~
a.cc: In function 'void _main()':
a.cc:59:5: error: 'rep' was not declared in this scope
   59 |     rep(i, 0, N) cin >> S[i];
      |     ^~~
a.cc: In function 'bool dfs(int, int, int, int)':
a.cc:55:1: warning: control reaches end of non-void function [-Wreturn-type]
   55 | }
      | ^
Language: C++

/*   ꧁༒☬महाकाल☬༒꧂ ꧁༒ঔमहाकालঔ༒꧂
                   
                   ঔৣ۝महाकालᴳᵒᵈ۝ঔৣ            
 
 */ 
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//template <typename T, typename cmp=less<T>> using oset =tree<T, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long 
#define mod 1000000007
#define inf 100000000000000000
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define _it iterator
#define all(_x) _x.begin(),_x.end()
#define f first
#define s second
#define pb push_back
void mahakal(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}
int main(){
	//mahakal(),fast;
	ll n , a, b , c ;
	cin>> n >> a >> b >> c ;
	string ans;
	for(ll i=0;i<n ;i++){
		string s;
		cin>> s ;
		if(s[0]=='A' && s[1]=='B'){
			ll mx=max(a,b);
			ll mn = min(a,b);
			if(mx==0 || mn<0){
				cout<<"No"<<endl;
				return 0;
			}
			if(a>=b)ans.pb('B'),a--,b++;
			else ans.pb('A'),a++,b--;
		}
		else if(s[0]=='B' && s[1]=='C'){
			ll mx=max(c,b);
			ll mn = min(c,b);
			if(mx==0 || mn<0){
				cout<<"No"<<endl;
				return 0;
			}
			if(c>=b)ans.pb('B'),c--,b++;
			else ans.pb('C'),c++,b--;
		}
		else{
			ll mx=max(a,c);
			ll mn = min(a,c)
			if(mx==0 || mn<0){
				cout<<"No"<<endl;
				return 0;
			}
			if(a>=c)ans.pb('C'),a--,c++;
			else ans.pb('A'),a++,c--;
		}
	}
	cout<<"Yes"<<endl;
	for(auto x:ans)cout<<x<<endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:25: error: expected ',' or ';' before 'if'
   59 |                         if(mx==0 || mn<0){
      |                         ^~
Language: C++

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

long long n, d[3] = {}, sum;
string res;
vector<string> s;

bool solve();

int main() {
  cin >> n;
  for (int i = 0; i < 3; ++i) cin >> d[i];
  s.resize(n);
  for (int i = 0; i < n; ++i) cin >> s[i];
  if (solve()) {
    cout << "Yes" << endl;
    for (int i = 0; i < n; ++i) cout << res[i] << endl;
  } else
    cout << "No" << endl;
  return 0;
}

bool solve() {
  sum = d[0] + d[1] + d[2];
  if (sum == 0) return 0;
  for (int i = 0; i < n; ++i) {
    string now = s[i];
    long long x = now[0] - 'A', y = now[1] - 'A';
    if (d[x] > d[y])
      swap(x, y);
    else if (d[x] == d[y]) {
      if (d[x] == 0) return 0;
      if (i + 1 < n && s[i] != s[i + 1] &&
          (y == s[i + 1][0] - 'A' || x[0] == s[i + 1][1] - 'A'))
        swap(x, y);
    }
    ++d[x];
    --d[y];
    res += x + 'A';
  }
  return 1;
}


Compiler output:
a.cc: In function 'bool solve()':
a.cc:34:39: error: invalid types 'long long int[int]' for array subscript
   34 |           (y == s[i + 1][0] - 'A' || x[0] == s[i + 1][1] - 'A'))
      |                                       ^
Language: C++

#include<bits/stdc++.h>
#define int long long
#define rep(i,a,b) for(int i=a;i<b;i+=1)
#define reps(i,a,b) for(int i=a;i>=b;i-=1)
#define vi vector<int>
#define pb push_back
#define pi pair<int, int>
#define mp make_pair
#define ff first
#define ss second
#define in(x) int x; cin>>x;
#define inn(x, y) int x, y; cin>>x>>y;
#define mi unordered_map<int,int>
#define mem(x) memset(x, 0, sizeof(x))
#define IOS ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
using namespace std;

int32_t main(void){
	IOS;
	
	inn(n, a);
	inn(b, c);
	string s[n+1];
	vector<char> ans;
	rep(i, 0, n) cin>>s[i];
	s[n] = "AB";
	rep(i, 0, n)
	{
		if(s[i] == "AB")
		{
			if(a < b) 
			{
				a+=1;
				b-=1;
				ans.pb('A');
			}
			else if(b < a)
			{
				b+=1;
				a-=1;
				ans.pb('B');
			}
			else
			{
				if(s[i+1] == "AC")
				{
					ans.pb('A');
					a += 1;
					b -= 1;
				}
				else
				{
					ans.pb('B');
					b += 1;
					a -= 1;
				}
			}
		}
		if(s[i] == "AC")
		{
			if(a < c) 
			{
				a+=1;
				c-=1;
				ans.pb('A');
			}
			else if(c < a)
			{
				c += 1;
				a -= 1;
				ans.pb('C');
			}
			else
			{
				if(s[i+1] == "AB")
				{
					ans.pb('A');
					a += 1;
					c -= 1;
				}
				else
				{
					ans.pb('C');
					c += 1;
					a -= 1;
				}
			}
		}
		if(s[i] == "BC")
		{
			if(c < b) 
			{
				c+=1;
				b-=1;
				ans.pb('C');
			}
			else if(c > b)
			{
				b+=1;
				c-=1;
				ans.pb('B');
			}
			else
			{
				if(s[i+1] == "AB")
				{
					ans.pb('B');
					b += 1;
					c -= 1;
				}
				else
				{
					ans.pb('C');
					c += 1;
					b -= 1;
				}
			}
		}
		if(a<0 || b<0 || c<0)
		{
			cout<<"No";
			return;
		}
	}
	
	cout<<"Yes"<<'\n';
	rep(i, 0, n) cout<<ans[i]<<'\n';
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:122:25: error: return-statement with no value, in function returning 'int32_t' {aka 'int'} [-fpermissive]
  122 |                         return;
      |                         ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(){
    int gg[3];
    int n; cin >> n >> gg[0] >> gg[1] >> gg[2];
    vector<string> da(n);
    rip(i,n,0) cin >> da[i];
    vector<int> ans(n);
    da.push_back("AB");
    rip(i,n,0){
        int x = da[i][0]-'A';
        int y = da[i][1]-'A';
        if(gg[x] == gg[y]){
            if(da[i+1][0] == da[i][0] || da[i+1][1] == da[i][0]){
                ans[i] = x;
                gg[x]++;
                gg[y]--;
            }
            else{
                ans[i] = y;
                gg[y]++;
                gg[x]--;
            }
            if(gg[x] < 0 || gg[y] < 0){
                cout << "No" << endl;
                return 0;
            }
        }
        else if(gg[x] > gg[y]){
            ans[i] = y;
            gg[y]++;
            gg[x]--;
        }
        else{
            ans[i] = x;
            gg[x]++;
            gg[y]--;
        }
    }
    cout << "Yes" << endl;
    rip(i,n,0) printf("%c\n", ans[i]+'A');
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'i' was not declared in this scope
   11 |     rip(i,n,0) cin >> da[i];
      |         ^
a.cc:11:5: error: 'rip' was not declared in this scope
   11 |     rip(i,n,0) cin >> da[i];
      |     ^~~
Language: C++

#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <bitset>
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)
 
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
 
int main() {
    std::ios::sync_with_stdio(0); cin.tie(0);
 
    ll i,j,h;
    ll Q,M,K,P,A,B,C,N,X;
 
    long double x;
 
    string S;
 
    ll ans=0;
    ll count=0;
    ll flag=0;
    ll temp=0;
 
vector<string> ss;
ll a,b;
    cin >>N>>A>>B>>C;
    ll d;
 
    ll iii=3;
    //cout<<pow(iii,0.2)<<endl;
    //return 0;
rep(i,N){
  cin>>S;
  ss.push_back(S);
}
map <char,ll> mm;
mm['B']=B;
mm['A']=A;
  mm['C']=C;
if(A+B+C==0){
  cout<<"No"<<endl;
}else if(A+B+C==1){
  rep(i,N){
  	if(mm[ss[i][0]]==0 && mm[ss[i][1]]==0){
      cout << "No"<<endl;
      return 0;
    }else if (mm[ss[i][0]]==0){
      mm[ss[i][0]]++;
      mm[ss[i][1]]--;
    }else{
      mm[ss[i][0]]--;
      mm[ss[i][1]]++;
    }
  }
}else{
	if(mm[ss[i][0]]==0 && mm[ss[i][1]]==0){
    cout<< "No"<<endl;
}
 

cout<<"Yes"<<endl;
//rep(i,N)cout<<ff[i];
 
    return 0;
}

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


// Problem : F - Three Variables Game
// Contest : AtCoder - AtCoder Beginner Contest 166
// URL : https://atcoder.jp/contests/abc166/tasks/abc166_f
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>

using namespace std;

string ss[100005];

int main(){
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int a[3];
	int N, A, B, C;
	cin >> N >> a[0] >> a[1] >> a[2];
	vector<char> ans;
	for(int i = 1; i<=N; i++){
		cin >> ss[i];
	}
	ss[N+1] = "AB";
	for(int i = 1; i<=N; i++){
		string s = ss[i];
		if(a[s[0]-'A'] == 0 && a[s[1]-'A'] == 0){
			cout << "No\n";
			return 0;
		}
		else if(a[s[0]-'A'] == a[s[1]-'A']){
			if(ss[i+1][0] == s[1] || s[i+1][1] == s[1]){
				a[s[1]-'A']++, a[s[0]-'A']--;
				ans.push_back(s[1]);
			}
			else{
				a[s[1]-'A']--, a[s[0]-'A']++;
				ans.push_back(s[0]);
			}
		}
		else if(a[s[0]-'A'] > a[s[1]-'A']){
			ans.push_back(s[1]);
			a[s[0]-'A']--, a[s[1]-'A']++;
		}
		else{
			ans.push_back(s[0]);
			a[s[0]-'A']++, a[s[1]-'A']--;
		}
	}
	cout << "Yes\n";
	for(auto c : ans){
		cout << c << "\n";
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:56: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   34 |                         if(ss[i+1][0] == s[1] || s[i+1][1] == s[1]){
      |                                                        ^
Language: C

#include <algorithm>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unordered_map>
#include <vector>

int main(){
  int N, A, B, C;
  scanf("%d", &N);
  scanf("%d", &A);
  scanf("%d", &B);
  scanf("%d", &C);
  std::queue<char > queue;
  bool result = true;
  std::vector<std::string > s(N);
  std::vector<std::string > next(N);
  next[N-1]="AB";
  for (int i=0; i<N; i++){
    std::cin >> s[i];
  }
  std::string cand = s[N-1];
  for (int i=N-2; i>0; i--){
    next[i]=cand;
    if (s[i-1]!=s[i]) cand=s[i];
  }
  next[0]=cand;

  for (int i=0; i<N; i++){
    if (s[i]=="AB"){
      if (A==B && next[i]=="BC"){
        B++;
        A--;
        queue.push('B');
      } else if (A==B && next[i]=="AC"){
        A++;
        B--;
        queue.push('A');
      } else if(A>B) {
        A--;
        B++;
        queue.push('B');
      } else {
        A++;
        B--;
        queue.push('A');
      }
      if (A<0 || B<0){
        result = false;
      }
    } else if (s[i]=="BC"){
      if (B==C && next[i]=="AC"){
        C++;
        B--;
        queue.push('C');
      } else if (B==C && next[i]=="AB"){
        B++;
        C--;
        queue.push('B');
      } else if(B>C) {
        B--;
        C++;
        queue.push('C');
      } else {
        B++;
        C--;
        queue.push('B');
      }
      if (B<0 || C<0){
        result = false;
      }
    } else {
      if (A==C && next[i]=="AB"){
        A++;
        C--;
        queue.push('A');
      } else if (A==C && next[i]=="BC"){
        C++;
        A--;
        queue.push('C');
      } else if(C>A) {
        C--;
        A++;
        queue.push('A');
      } else {
        C++;
        A--;
        queue.push('C');
      }
      if (C<0 || A<0){
        result = false;
      }
    }
  }
  if (result){
    printf("Yes\n");
    while(queue.size()>0){
      char value = queue.front();
      printf("%c\n", value);
      queue.pop();
    }
  } else {
    printf("No\n");
  }
  return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
#define M 1000000007
#define U 998244353
#define N 1000005
#define int long long
#define sz(c) (int)c.size()
#define fr first
#define ll long long 
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a ; i<n ; i++)
#define r0 return 0;
#define endl '\n'
#define INF (int)1e15
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
signed main()
{
	ios_base::sync_with_stdio(0);
	int TESTS=1;
	// cin>>TESTS;
	while(TESTS--)
	{   
		int n,a,b,c;
		cin >> n >> a >> b >> c;
		map<char, int> m;
		m['A'] = a;
		m['B'] = b;
		m['C'] = c;
		vector<string> v;
		rep(i,0,n){
			string s;
			cin >> s;
			v.pb(s);
		}
		vector<string> ans;
		for(auto j:v){
			if(m[j[0]] == 0 and m[j[1]] == 0){
				cout << "No";
				r0;
			}
			if(m[j[0]] >= m[j[1]]){
				m[j[0]]--;
				m[j[1]]++;
				ans.pb(string(1,j[0]));
			}
			else{
				m[j[1]]--;
				m[j[0]]++;
				ans.pb(string(1,j[1]));
			}
		}
		cout << "Yes" << endl;
		for(auto j:ans) cout << j << endl;
	}
}

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