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

#include<stdio.h>
#include<string.h>
#define rep(i,n) for(i=0;i<n;i++)
int max(int a,int b){
    return a>b?a:b;
}

int main(void){
    int n,m,i,j,k,l,f;
    char s[50][51],t[50][51];
    while(scanf("%d",&n),n){
        l=0;
        rep(i,n){
            scanf("%s",s[i]);
            l=max(l,strlen(s[i]));
        }
        memset(t,0,sizeof(t));
        rep(k,l+1){
            rep(i,n){
                t[i][0]=s[i][0];
                j=1;
                m=0;
                while(s[i][m]&&j<k){
                    if(strchr("aiueo",s[i][m])!=NULL)){
                        t[i][j++]=s[i][m];
                    }
                    m++;
                }
                t[i][j]=0;
            }
            f=1;
            rep(i,n){
                rep(j,n){
                    if(i!=j&&strcmp(t[i],t[j])==0){
                        f=0;
                    }
                }
            }
            if(f)break;
        }
        printf("%d\n",f?k:-1);
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:24:54: error: expected statement before ')' token
   24 |                     if(strchr("aiueo",s[i][m])!=NULL)){
      |                                                      ^
Language: C++

#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;

string s[51], t[51];

bool check(int n, int k) {
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      //cout << i << " " << j << " ";
      //cout << t[i].substr(0, k) << " " << t[j].substr(0, k) << endl;
      if (t[i].substr(0, k) == t[j].substr(0, k)) return false;
    }
  }
  return true;
}

int main(void) {
  int n, ans = -1, m_size = 0;
  cin.tie(0);
  ios::sync_with_stdio(false);

  while (cin >> n, n) {
    ans = -1;
    memset(s, 0, sizeof(s));
    memset(t, 0, sizeof(t));
    for (int i = 0; i < n; i++) {
      cin >> s[i];
      if(s[i].size() > m_size) m_size = s[i].size();
    }
    for (int j = 0; j < n; j++) t[j] = s[j][0];

    //for (int j = 0; j < n; j++) cout << t[j] << endl;

    for (int j = 0; j < n; j++) {
      for (int k = 1; k < s[j].size(); k++) {
        if (s[j][k-1] == 'a' || s[j][k-1] == 'i' || s[j][k-1] == 'u' || s[j][k-1] == 'e' || s[j][k-1] == 'o') {
          t[j]+=s[j][k];
        }
      }
    }
    //sort(t, t + n);
    //for (int k = 0; k < n; k++) cout << t[k] << endl;

    for (int i = 1; i <= m_size; i++) {
      //cout << i << endl;
      if(check(n, i)) {
        ans = i;
        break;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
sakamo

Compiler output:
a.cc:58:1: error: 'sakamo' does not name a type
   58 | sakamo
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define r(i,n) for(i=0;i<n;i++)
using namespace std;
int main(){
  int n,i,j,q;
  while(cin>>n,n){
    int m=0,tt;
    string p[n],s[n];
    r(i,n){cin>>p[i];}
    r(i,n){tt=p[i].size();r(j,tt){
      if(!j)s[i]+=p[i][j];
      else{if(p[i][j-1]=='a'||p[i][j-1]=='i'||p[i][j-1]=='u'||p[i][j-1]=='e'||p[i][j-1]=='o')s[i]+=p[i][j];}
    }}
    r(i,n){tt=s[i].size();m=max(m,tt);}
    string t[n];
    r(i,m){
      int p=0;
      r(j,n)if(i<s[j].size())t[j]+=s[j][i];
    r(j,n)for(int k=j+1;k<n;k++){if(t[k]==t[j])p++;
      if(!p)goto L;
    }
    cout<<-1<<endl;
    if(0){L:;cout<<i+1<<endl;}
  }
}

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

#include <bits/stdc++.h>

#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define rep(i,n) reps(i,0,n)
#define rrep(i,n) for(int i=n-1; i>=0: i--)
#define X first
#define Y second
#define pb push_back

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

const ll INF = 1e9;



bool B[3][2][2][2];
int H, N;




int solve(int n, bool q[][4][4]){
	bool p[20][4][4];


	if(n==N){
		return 0;

		rep(i,20){
			bool f=false;
			rep(j,4)rep(k,4) f |= q[i][j][k];
			if(f) continue;
			return i;
		}
	}

	int ret = -INF;
	rep(x,3) rep(y,3){
		rep(i,20)rep(j,4)rep(k,4) p[i][j][k] = q[i][j][k];

		int a=17;
		for(;a>=0; --a){
			bool f=false;
			rep(i,2) rep(j,2)rep(k,2){
				if(B[n][i][j][k] && p[a+i][x+j][y+k]) f=true;
			}
			if(f)break;
		}
		a++;
		
		rep(i,2)rep(j,2)rep(k,2) p[a+i][x+j][y+k] |= B[n][i][j][k];
		
		bool f=false;
		rep(i,20)rep(j,4)rep(k,4){
			if(j==1 && k==1)continue;
			if(j==2 && k==1)continue;
			if(j==1 && k==2)continue;
			if(j==2 && k==2)continue;
			if(p[i][j][k]) f=true;
		}
		if(f)continue;
		
		int b=0;
		int rr=0;
		rep(i, 20){
			bool f=true;

			reps(j,1,3) reps(k,1,3){
				f &= p[i][j][k];
			}
			if(f){
				rr++;
				continue;
			}

			rep(j,4)rep(k,4){
				p[b][j][k] = p[i][j][k];
			}
			b++;
		}
	
	/*
		printf("a%d %d %d:%d %d\n", n, x, y, rr,a);
		rep(i, 20){
			rep(j,4){
				rep(k,4) cerr << (p[i][j][k]?'$':'.') << ' ';
				cerr << endl;
			}
			cerr << endl;
		}
		cerr << endl;
*/
		
		for(;b<20;++b){
			rep(j,4)rep(k,4) p[b][j][k] = false;
		}
			
		int r = solve(n+1, p)+rr;
		ret = max(ret, r);
	}
	return ret;
}


int main(){

	for(;;){
		bool p[20][4][4];
		rep(i,20)rep(j,4)rep(k,4) p[i][j][k] = false;

		cin >> H >> N;
		if(H+N==0)break;

		rep(i,H)rep(j,2){
			string s;
			cin >> s;

			p[i][j+1][1] = s[0] =='#';
			p[i][j+1][2] = s[1] =='#';
		}
		
		int bn = 0;
		rep(a,N){
			bool g=false;
			rep(i,2){
				bool f=false;
				rep(j,2){
					string s;
					cin >> s;
					B[a][i][j][0] = s[0] == '#';
					B[a][i][j][1] = s[1] == '#';
					f |= s[0] == '#'; 
					f |= s[1] == '#'; 
				}
				if(f) bn++;
				if(i==0) g=!f;
			}
			if(g){
				rep(i,2) rep(j,2){
					B[a][0][i][j] = B[a][1][i][j];
					B[a][1][i][j] = false;
				}
			}
		}
		/*
		rep(i, 20){
			rep(j,4){
				rep(k,4) cerr << (p[i][j][k]?'$':'.') << ' ';
				cerr << endl;
			}
			cerr << endl;
		}
		cerr << endl;
		*/
		/*	
		rep(a, N){
			rep(i, 2){
				rep(j,2){
					rep(k,2) cerr << (B[a][i][j][k]?'$':'.') << ' ';
				cerr << endl;
				}
				cerr << endl;
			}
			cerr << endl;
		}
		cerr << endl;
		*/


		int r = solve(0, p);
		cerr << r << endl;
		cout << r << endl;

		//cout << H+2*N-bn-r << endl;
	}
}

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 <iostream>
#include <queue>
#include <utility>
#include <tuple>
using namespace std;

int H, W, R, C;

enum { LEFT, UP, RIGHT, DOWN };
int di[] = { 0, -1, 0, +1 };
int dj[] = { -1, 0, +1, 0 };

int door[510][510][4];
int ok[510][510];
int vis[510][510];

bool check(int i, int j) {
    int flg[2] = {};
    for (int d = 0; d < 4; ++d) {
        int ni = i + di[d];
        int nj = j + dj[d];
        if (ni < 0 || nj < 0 || ni >= H || nj >= W || ok[ni][nj]) {
            flg[door[i][j][d]] = true;
        }
    }
    return flg[0] && flg[1];
}

int main() {
    while (cin >> H >> W >> R >> C && H) {
        --R, --C;
        memset(ok, 0, sizeof ok);
        memset(vis, 0, sizeof vis);
        for (int i = 0; i < 2 * H + 1; ++i) {
            if (i % 2 == 0) {
                for (int j = 0; j < W; ++j) {
                    int x;
                    cin >> x;
                    door[i / 2][j][UP] = x;
                    if (i / 2 != 0) {
                        door[i / 2 - 1][j][DOWN] = x;
                    }
                }
            } else {
                for (int j = 0; j < W + 1; ++j) {
                    int x;
                    cin >> x;
                    door[i / 2][j][LEFT] = x;
                    if (j != 0) {
                        door[i / 2][j - 1][RIGHT] = x;
                    }
                }
            }
        }

        using pii = pair<int, int>;
        queue<pii> q;
        for (int i = 0; i < H; ++i) {
            for (int j = 0; j < W; ++j) {
                q.emplace(i, j);
            }
        }
        while (q.size()) {
            int ci, cj;
            tie(ci, cj) = q.front();
            q.pop();
            if (!check(ci, cj)) continue;
            ok[ci][cj] = true;
            if (vis[ci][cj]) continue;
            vis[ci][cj] = true;
            for (int d = 0; d < 4; ++d) {
                int ni = ci + di[d];
                int nj = cj + dj[d];
                if (ni < 0 || nj < 0 || ni >= H || nj >= W ||
                    ok[ni][nj] || vis[ni][nj]) continue;
                q.emplace(ni, nj);
            }
        }

        cout << (ok[R][C] ? "Yes" : "No") << endl;

    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'memset' was not declared in this scope
   32 |         memset(ok, 0, sizeof ok);
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <utility>
  +++ |+#include <cstring>
    4 | #include <tuple>
Language: C++



#include <bits/stdc++.h>

using namespace std;

int H,W,Y,X;

vector<vector<int>> wy;

vector<vector<int>> wx;

typedef tuple<int,int,int> T;

map<T,int> mp;

bool search(int y,int x,int w){

  if(y<0 || y>=H) return true;

  if(x<0 || x>=W) return true;

  if(mp.find(T(y,x,w))!=mp.end())

    return mp[T(y,x,w)];

  mp[T(y,x,w)]=false;

  //???

  if(wy[y][x]!=w){

    bool ret=search(y-1,x,w)&search(y-1,x,!w);

    if(ret){

      mp[T(y,x,w)]=true;

      return true;

    }

  }

  //???

  if(wy[y+1][x]!=w){

    bool ret=search(y+1,x,w)&search(y+1,x,!w);

    if(ret){

      mp[T(y,x,w)]=true;

      return true;

    }

  }

  //???

  if(wx[y][x]!=w){

    bool ret=search(y,x-1,w)&search(y,x-1,!w);

    if(ret){

      mp[T(y,x,w)]=true;

      return true;

    }

  }

  //???

  if(wx[y][x+1]!=w){

    bool ret=search(y,x+1,w)&search(y,x+1,!w);

    if(ret){

      mp[T(y,x,w)]=true;

      return true;

    }

  }

  mp[T(y,x,w)]=false;

  return false;

}

???

int main(){

  while(cin >> H >> W >> Y >> X, H){

    Y--;

    X--;

    mp.clear();

    wy.assign(H+1,vector<int>(W));

    wx.assign(H,vector<int>(W+1));

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

      for(int j=0;j<W;j++)

	cin >> wy[i][j];

      for(int j=0;j<=W;j++)

	cin >> wx[i][j];

    }

    for(int j=0;j<W;j++)

      cin >> wy[H][j];

    if(search(Y,X,1))

      cout << "Yes" << endl;

    else

      cout << "No" << endl;

  }

  return 0;

}

Compiler output:
a.cc:99:1: error: expected unqualified-id before '?' token
   99 | ???
      | ^
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of '_ForwardIterator std::search(_ForwardIterator, _ForwardIterator, const _Searcher&) [with _ForwardIterator = int; _Searcher = bool]':
a.cc:33:36:   required from here
   33 |     bool ret=search(y-1,x,w)&search(y-1,x,!w);
      |                              ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4186:24: error: expression cannot be used as a function
 4186 |     { return __searcher(__first, __last).first; }
      |              ~~~~~~~~~~^~~~~~~~~~~~~~~~~
Language: C++

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;

int h, w, r, c;
vector<vector<int>> horz;
vector<vector<int>> vert;
vector<vector<vector<vector<int>>>> dp;

int dh[] = { 1,-1,0,0 };
int dw[] = { 0,0,1,-1 };

bool isrange(int i, int j) {
	return 0 <= i && i<h && 0 <= j && j<w;
}
int cnt = 0;
int dfs(int ih, int jw, bool wall, bool turn) {
	cnt++;
	if (cnt >= 1e7) return false;
	if (!isrange(ih, jw)) return 1;
	if (dp[ih][jw][wall][turn] != -1) {
		return dp[ih][jw][wall][turn];
	}
	int res;
	dp[ih][jw][wall][turn] = 0;
	if (turn == 0) {
		//KOMA turn
		res = 0;
		for (int dir = 0; dir<4; dir++) {
			if (dh[dir] != 0) {
				int val = ih + (dh[dir] + 1) / 2;
				if (val<0 && val >= horz.size()) return true;
				bool iswall = horz[val][jw];
				if (wall) iswall = !iswall;
				if (!iswall) {
					int toh = ih + dh[dir];
					int tow = jw + dw[dir];
					if (!isrange(toh, tow)) return 1;
					res |= dfs(toh, tow, wall, !turn);
				}
			}
			else {
				int val = jw + (dw[dir] + 1) / 2;
				if (val<0 || val >= vert[ih].size()) return true;
				bool iswall = vert[ih][val];
				if (wall) iswall = !iswall;
				if (!iswall) {
					int toh = ih + dh[dir];
					int tow = jw + dw[dir];
					if (!isrange(toh, tow)) return 1;
					res |= dfs(toh, tow, wall, !turn);
				}
			}
		}
	}
	else {
		//wall turn
		res = 1;
		res &= dfs(ih, jw, wall, !turn);
		res &= dfs(ih, jw, !wall, !turn);
	}
	return dp[ih][jw][wall][turn] = res;
}

int main() {
	//  ??°????????????????????????????¢??????????
	const int size = 128 * 1024 * 1024;
	void *p = malloc(size);
	long long esp_new = (long long)p + size - 1;

	//  ??????????????????????????????
	__asm__("mov %rsp, esp_org");
	__asm__("mov esp_new, %rsp");


	while (cin >> h >> w >> r >> c, h) {
		cnt = 0;
		r--, c--;
		horz.clear();
		vert.clear();
		dp.clear();
		horz.resize(h + 1);
		vert.resize(h);
		for (int i = 0; i<2 * h + 1; i++) {
			if (i % 2 == 0) {
				int index = i / 2;
				horz[index].resize(w);
				for (int j = 0; j<w; j++) cin >> horz[index][j];
			}
			else {
				int index = i / 2;
				vert[index].resize(w + 1);
				for (int j = 0; j<w + 1; j++) cin >> vert[index][j];
			}
		}
		dp.resize(h * 2, vvvi(w * 2, vvi(2, vi(2, -1))));
		bool res = dfs(r, c, 0, 0);
		cout << (res ? "Yes" : "No") << endl;
	}

	//  ???????????????????????????
	__asm__("mov esp_org, %rsp");

	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccVnUWPD.o: relocation R_X86_64_32S against undefined symbol `esp_org' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
using board3D = vector< vector< vector<int> > >;
using board2D = vector< vector<int> >;

int H, W, R, C;
vector< vector< vector<int> > > orig, modi;
int memo[510][510][2], visited[510][510];

// up, left, down, right
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, -1, 0, 1};

void construct(const board2D& UD, const board2D& LR, board3D& board) {
  // printf("construct\n");
  for(int i=0; i<H; i++) {
    for(int j=0; j<W; j++) {
      board[i][j][0] ^= UD[i][j];
      board[i][j][1] ^= LR[i][j];
      board[i][j][2] ^= UD[i+1][j];
      board[i][j][3] ^= LR[i][j+1];

      // printf("coor = %d, %d: %d %d %d %d\n", i+1, j+1, board[i][j][0], board[i][j][1], board[i][j][2], board[i][j][3]);
    }
  }
}

int solve(int x, int y, int f) {
  int &val = memo[x][y][f];
  board3D& board = (f == 0 ? orig : modi);
  if(val != -1) return val;

  for(int k=0; k<4; k++) {
    // wall
    if(board[x][y][k]) continue;
    int nx = x + dx[k], ny = y + dy[k];
    if(nx < 0 || nx >= H || ny < 0 || ny >= W) {
      // out
      return val = true;
    }

    if(visited[nx][ny]) continue;
    visited[nx][ny] = true;
    int v1 = solve(nx, ny, 0);
    int v2 = solve(nx, ny, 1);
    visited[nx][ny] = false;
    if(v1 == 1 && v2 == 1) return val = 1;
  }

  return val = 0;
}

int main() {
  while(1) {
    cin >> H >> W >> R >> C;
    R--; C--;
    if(!H) break;

    vector< vector<int> > UD(H+1, vector<int>(W+1));
    vector< vector<int> > LR(H+1, vector<int>(W+1));
    orig.clear();
    modi.clear();
    orig.resize(H, vector< vector<int> >(W, vector<int>(4, 0)));
    modi.resize(H, vector< vector<int> >(W, vector<int>(4, 1)));

    for(int i=0; i<2*H+1; i++) {
      int lim = (i % 2 == 0 ? W : W + 1);
      for(int j=0; j<lim; j++) {
        cin >> (i % 2 == 0 ? UD : LR)[i/2][j];
      }
    }

    construct(UD, LR, orig);
    construct(UD, LR, modi);

    memset(memo, -1, sizeof(memo));
    memset(visited, false, sizeof(visited));
    int ans = solve(R, C, 0);
    cout << (ans ? "Yes" : "No") << endl;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:78:5: error: 'memset' was not declared in this scope
   78 |     memset(memo, -1, sizeof(memo));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <cstdio>
//cin.sync_with_stdio(false);
//streambuf
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
//using pll = pair<ll, ll>;
using pii = pair<unsigned short, unsigned short>;
typedef pair<double, double> pdd;
using vi = vector<int>;
using vll = vector<ll>;
using vpii = vector<pii>;
using ti3 = tuple<int, int, int>;
using vti3 = vector<ti3>;
template<class T, class T2> using umap = unordered_map<T, T2>;
template<class T> using uset = unordered_set<T>;
#define ALL(a) a.begin(),a.end()
#define rep(i,a) for(int i=0;i<(a);i++)
#define rep1(i,a) for(int i=1;i<=(a);i++)
#pragma warning(disable:4996)
//#define INF 1000000000000000.0
template <class T>
inline void hash_combine(std::size_t & seed, const T & v)
{
	std::hash<T> hasher;
	seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
namespace std
{
	template<typename S, typename T> struct hash<pair<S, T>>
	{
		inline size_t operator()(const pair<S, T> & v) const
		{
			size_t seed = 0;
			::hash_combine(seed, v.first);
			::hash_combine(seed, v.second);
			return seed;
		}
	};
}
enum {
	l, r, f, b, d, u
};
int main() {
	int n;
	while (cin >> n, n) {
		vector<umap<pii, int>> dice(n);
		rep(i, n) {
			int x, y;
			cin >> x >> y;
			vi buf(6);
			for (auto&a : buf)cin >> a;
			string dl;
			cin >> dl;
			dice[i][pii(x, y)] = buf[4];
			for (char a : dl) {
				switch (a) {
				case'L':
					buf = { buf[u],buf[d],buf[f],buf[b],buf[l],buf[r] };
					x--;
					break;
				case 'R':
					buf = { buf[d],buf[u],buf[f],buf[b],buf[r],buf[l] };
					x++;
					break;
				case 'F':
					buf = { buf[l],buf[r],buf[u],buf[d],buf[f],buf[b] };
					y--;
					break;
				case 'B':
					buf = { buf[l],buf[r],buf[d],buf[u],buf[b],buf[f] };
					y++;
				}
				dice[i][pii(x, y)] = buf[d];
			}
		}
		vector < pair<unsigned short, umap<pii, char>>> dp(1 << n);
		rep(i, 1 << n) {
			rep(j, n) {
				if (!(i & 1 << j))continue;
				int src = i&~(1 << j);
				int s = dp[src].first;
				for (auto a : dice[j]) {
					s += a.second;
					if (dp[src].second.count(a.first))s -= dp[src].second[a.first];
				}
				if (s > dp[i].first) {
					dp[i].first = s;
					for (auto&a : dp[src].second)dp[i].second[a.first] = a.second;
					for (auto&a : dice[j])dp[i].second[a.first] = a.second;
				}
			}
		}
		cout << dp[(1 << n) - 1].first << endl;
	}
}

Compiler output:
a.cc:24:7: error: conflicting declaration 'using pii = struct std::pair<short unsigned int, short unsigned int>'
   24 | using pii = pair<unsigned short, unsigned short>;
      |       ^~~
a.cc:22:24: note: previous declaration as 'typedef struct std::pair<int, int> pii'
   22 | typedef pair<int, int> pii;
      |                        ^~~
Language: C

#include <iostream>
#include <numeric>
using namespace std;
#define FOR(i,a,b) for (size_t i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (size_t i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define INF 1e7

int main()
{
  int p, q, r;
  cin>>p>>q;

  RFOR(i,p+1,1) {
    if (!(p%i | q%i)) {
      r = i;
      break;
    }
  }

  cout<<q/r<<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 <iostream>
#include <cmath>
using namespace std;

int gcd(int a,int b){
    if(a<b){swap(a,b);}
    if(!b){return a;}
    return gcd(b,a%b);
}

int main(){
    int a=1,p,q,i,gc;
    vector<int> cds;
    cin>>p>>q;
    gc=gcd(p,q);
    p/=gc;q/=gc;
    for(i=2;i<sqrt(q)+1;i++){
        if(!(q%i)){
            a*=i;
            while(!(q%i)){q/=i;}
        }        
    }
    a*=q;
    cout<<a<<endl;
    return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'vector' was not declared in this scope
   13 |     vector<int> cds;
      |     ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <cmath>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:13:12: error: expected primary-expression before 'int'
   13 |     vector<int> cds;
      |            ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int p, q, r = 1;
int main() {
	scanf("%d%d", &p, &q);
	q = q / _gcd(p, q);
	for(int i = 2; i * i <= q; i++) {
		if(q % i == 0) {
			r *= i;
			while(q % i == 0) q /= i;
		}
	}
	printf("%d\n", r * q);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: '_gcd' was not declared in this scope
    6 |         q = q / _gcd(p, q);
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

ll gcd ( ll a, ll b ){
  ll c;
  while ( a != 0 ) {
     c = a; a = b%a;  b = c;
  }
  return b;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll p,q;
  cin >>p>>q;
  ll g=gcd(p,q);
  ll res=q/g;
//  if(res==1) res=10;
  cout << max(res,2) <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:14: error: no matching function for call to 'max(ll&, int)'
   23 |   cout << max(res,2) <<endl;
      |           ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:23:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   23 |   cout << max(res,2) <<endl;
      |           ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:23:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   23 |   cout << max(res,2) <<endl;
      |           ~~~^~~~~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <numeric>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<((x))<<endl
#define fi first
#define se second

#define INF 2147483600
#define long long long

int main(){
  int p,q;
  cin>>p>>q;
  int g =

Compiler output:
a.cc: In function 'int main()':
a.cc:33:10: error: expected primary-expression at end of input
   33 |   int g =
      |          ^
a.cc:33:10: error: expected '}' at end of input
a.cc:30:11: note: to match this '{'
   30 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int gcd(int a, int b){
    if(b==0) return a;
    else return gcd(b, a%b);
}

int main(){

    int p, q;
    cin>> p>> q;

    q=q/gcd(p, q);
    vector<int> v;
    for(int i=2; i*<=q; i++){
        if(q%i==0){
            v.push_back(i);
            while(q%i==0) q/=i;
        }
    }
    int r=1;
    for(int i=0; i<v.size(); i++) r*=v[i];

    cout<< r<< endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: expected primary-expression before '<=' token
   18 |     for(int i=2; i*<=q; i++){
      |                    ^~
Language: C++

#include <bits/stdc++.h>??

using namespace std;??

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; scanf("%lld", &x);

//int dxy[5] = {0, 1, 0, -1, 0};
// assign??

vi prime;

int gcd(int a, int b)
{
if (a == 1) { 
return b;
} else {
return gcd(b, b%a);
}
}

void pri()
{
vector<bool> state(5001, false);
for (int i = 2; i < 5000; i++) {
if (!state[i]) {
prime.pb(i);
for (int j = 2; i*j < 5000; j++) {
state[i*j] = true;
}
}
}
}


signed main()
{
pri();
Int(p)
Int(q)
while (p && q) { 
if ( p >= q) {
cout << 2 << endl;
} else {
int ret = gcd(p, q);
int ans = 1;
while (ret != 1) {
rep(i, prime.length()) {
if (!(ret % prime[i])) {
ans *= prime[i];
ret /= prime[i];
}}}
cout << ans << endl;
}
cin >> p >> q;}


return 0;
}

Compiler output:
a.cc:1:25: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>??
      |                         ^
a.cc:3:21: error: expected unqualified-id before '?' token
    3 | using namespace std;??
      |                     ^
a.cc: In function 'void pri()':
a.cc:42:1: error: 'prime' was not declared in this scope
   42 | prime.pb(i);
      | ^~~~~
a.cc: In function 'int main()':
a.cc:63:8: error: 'prime' was not declared in this scope
   63 | rep(i, prime.length()) {
      |        ^~~~~
a.cc:9:39: note: in definition of macro 'rep'
    9 | #define rep(i, N) for (int i = 0; i < N; i++)
      |                                       ^
Language: C++

#include <bits/stdc++.h>

using namespace std; 

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; scanf("%lld", &x);

//int dxy[5] = {0, 1, 0, -1, 0};
// assign??

vi prime;

int gcd(int a, int b)
{
if (a == 1) { 
return b;
} else {
return gcd(b, b%a);
}
}

void pri()
{
vector<bool> state(5001, false);
for (int i = 2; i < 5000; i++) {
if (!state[i]) {
prime.pb(i);
for (int j = 2; i*j < 5000; j++) {
state[i*j] = true;
}
}
}
}


signed main()
{
pri();
Int(p)
Int(q)
while (p && q) { 
if ( p >= q) {
cout << 2 << endl;
} else {
int ret = gcd(p, q);
int ans = 1;
while (ret != 1) {
rep(i, prime.length()) {
if (!(ret % prime[i])) {
ans *= prime[i];
ret /= prime[i];
}}}
cout << ans << endl;
}
cin >> p >> q;}


return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:14: error: 'class std::vector<long long int>' has no member named 'length'
   63 | rep(i, prime.length()) {
      |              ^~~~~~
a.cc:9:39: note: in definition of macro 'rep'
    9 | #define rep(i, N) for (int i = 0; i < N; i++)
      |                                       ^
Language: C++

#include<iostream>
using namespace std:

int  main(){
int p, q;
cin >> p >> q;
cout << q/__gcd(p, q) << endl;
}

Compiler output:
a.cc:2:20: error: expected ';' before ':' token
    2 | using namespace std:
      |                    ^
      |                    ;
a.cc:2:20: error: expected unqualified-id before ':' token
Language: C++

#include<iostream>
using namespace std;

int  main(){
int p, q;
cin >> p >> q;
cout << q/__gcd(p, q) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: '__gcd' was not declared in this scope
    7 | cout << q/__gcd(p, q) << endl;
      |           ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long p,q;
    cin >> p >> q;
    int va=q;
    int ans=0;
    for(long long i=2;i*i<=va;i++){
    	if(ans!=0)
    		break;
    	if(q%i==0){
    		ans=-1;
    		while(q%i==0){
    			q/=i;
    			//cout << q << endl;
    		}
    		if(q==1)
    			ans=i;
    	}
    }
    if(ans!=0&&ans!=-1){
    	//cout << "=============" << q <<  endl;
    	cout << ans << endl;
    }
    else{
    	q=va;
    for(long long i=2;i*i<=va;i++){
        if(p==1)break;
        while(p%i==0&&q%i==0){
            p/=i;
            q/=i;
        }
    }
    //cout << q << endl;
    /*for(long long i=2;i*i<=va;i++){
        if((double)pow(q,(float)1/i)-(long long int)pow(q,(float)1/i)==0){
            q/=(long long int)pow(q,(float)1/i);
        }
    }
    cout << q << endl;
    }*/
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long p,q;
    cin >> p >> q;
    int va=q;
    int ans=0;
    for(long long i=2;i*i<=va;i++){
    	if(ans!=0)
    		break;
    	if(q%i==0){
    		ans=-1;
    		while(q%i==0){
    			q/=i;
    			//cout << q << endl;
    		}
    		if(q==1)
    			ans=i;
    	}
    }
    if(ans!=0&&ans!=-1){
    	//cout << "=============" << q <<  endl;
    	cout << ans << endl;
    }
    else{
    	q=va;
    for(long long i=2;i*i<=va;i++){
        if(p==1)break;
        while(p%i==0&&q%i==0){
            p/=i;
            q/=i;
        }
    }
    cout << q << endl;
    /*for(long long i=2;i*i<=va;i++){
        if((double)pow(q,(float)1/i)-(long long int)pow(q,(float)1/i)==0){
            q/=(long long int)pow(q,(float)1/i);
        }
    }
    cout << q << endl;
    }*/
    return 0;
}

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

import math
p, q = map(int, input().split())
g = math.gcd(p, q)
p //= g
q //= g
ret = q
for b in range(1, 40000):
    if b ** 1000 * p % q == 0:
        ret = min(ret, b)
print(ret)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<sstream>
#include<cmath>
#include<stack>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<int,int>
#define ll __int64
ll p,q;
int main(){
cin>>p>>q;
for(ll i=2;i<=1000;i++){
	if(p*i%q==0){
		cout<<i<<endl;
		break;
	}
}
	return 0;
}


Compiler output:
a.cc:18:12: error: '__int64' does not name a type; did you mean '__int64_t'?
   18 | #define ll __int64
      |            ^~~~~~~
a.cc:19:1: note: in expansion of macro 'll'
   19 | ll p,q;
      | ^~
a.cc: In function 'int main()':
a.cc:21:6: error: 'p' was not declared in this scope
   21 | cin>>p>>q;
      |      ^
a.cc:21:9: error: 'q' was not declared in this scope
   21 | cin>>p>>q;
      |         ^
a.cc:18:12: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   18 | #define ll __int64
      |            ^~~~~~~
a.cc:22:5: note: in expansion of macro 'll'
   22 | for(ll i=2;i<=1000;i++){
      |     ^~
a.cc:22:12: error: 'i' was not declared in this scope
   22 | for(ll i=2;i<=1000;i++){
      |            ^
Language: C++

import math

p = int(input())
q = int(input())

print(q/(math.gcd(p,q)))


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b,i,j,m[1e8]={0},c=0;
  cin>>a>>b;
  for(i=0;i<a;i++){
    while(m[c])c++;
    for(j=c;j<1e8;j+=b){
      if(i==a-1){
        cout<<j<<endl;
        break;
      }
      m[j]++;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:17: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    4 |   int a,b,i,j,m[1e8]={0},c=0;
      |                 ^~~
a.cc:4:17: error: could not convert '1.0e+8' from 'double' to 'long unsigned int'
    4 |   int a,b,i,j,m[1e8]={0},c=0;
      |                 ^~~
      |                 |
      |                 double
a.cc:4:17: error: size of array 'm' has non-integral type 'double'
Language: C++

long long c;n;main(k){for(scanf("%d%d",&n,&k);--n;)c+=c/(k-1)+1;n=!printf("%lld\n",c);}

Compiler output:
a.cc:1:13: error: 'n' does not name a type
    1 | long long c;n;main(k){for(scanf("%d%d",&n,&k);--n;)c+=c/(k-1)+1;n=!printf("%lld\n",c);}
      |             ^
a.cc:1:19: error: expected constructor, destructor, or type conversion before '(' token
    1 | long long c;n;main(k){for(scanf("%d%d",&n,&k);--n;)c+=c/(k-1)+1;n=!printf("%lld\n",c);}
      |                   ^
Language: C++


using namespace std;

int main() {
  int N, k;
  scanf("%d %d", &N, &k);
  int ans;
  if (N <= k) {
    ans = N-1;
  } else {
    ans = 0;
    for (int i=0;i<N;i++) {
      ans++;
      for (int j=1;j<ans;j++) {
        if (j%k == 0) ans++;
      }
    }
    ans--;
  }
  printf("%d\n", ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'scanf' was not declared in this scope
    6 |   scanf("%d %d", &N, &k);
      |   ^~~~~
a.cc:20:3: error: 'printf' was not declared in this scope
   20 |   printf("%d\n", ans);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 |
Language: Java

package aoj.volume27.jags2015;

import com.sun.org.apache.regexp.internal.RE;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;

import static java.lang.Integer.parseInt;

/**
 * ABC Gene
 */
public class Main {

	static final String TARGET = "ABC";
	static final String[] REP = {"A", "B", "C"};

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		String[] words;

		Deque<String> queue = new ArrayDeque<>();

		queue.offer(br.readLine());
		boolean ans = false;

		while (!queue.isEmpty()) {

			String s = queue.poll();

			System.out.println(s);

			if (s.equals(TARGET)) {
				ans = true;
				break;
			}

			for (String r : REP) {
				String _s = s.replace(TARGET, r);
				if (!_s.equals(s)) {
					queue.offer(_s);
				}
			}
		}

		System.out.println(ans ? "Yes" : "No");

	} //end main

	static String replace(String s, char r) {
		char[] ss = s.toCharArray();
		int count = 0;
		for (int i = 1; i < ss.length - 1; i++) {
			if (ss[i - 1] == 'A' && ss[i] == 'B' && ss[i + 1] == 'C') {
				ss[i] = r;
				ss[i - 1] = '_';
				ss[i + 1] = '_';
				count++;
			}
		}
		if (count == 0) {
			return s;
		}
		char[] _ss = new char[ss.length - count * 2];
		for (int i = 0, j = 0; i < ss.length; i++) {
			if (ss[i] != '_') {
				_ss[j] = ss[i];
				j++;
			}
		}
		return String.valueOf(_ss);
	}

}

Compiler output:
Main.java:3: error: package com.sun.org.apache.regexp.internal does not exist
import com.sun.org.apache.regexp.internal.RE;
                                         ^
1 error
Language: Java

import com.sun.org.apache.regexp.internal.RE;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;

import static java.lang.Integer.parseInt;

/**
 * ABC Gene
 */
public class Main {

	static final String TARGET = "ABC";
	static final String[] REP = {"A", "B", "C"};

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		String[] words;

		Deque<String> queue = new ArrayDeque<>();

		queue.offer(br.readLine());
		boolean ans = false;

		while (!queue.isEmpty()) {

			String s = queue.poll();

			System.out.println(s);

			if (s.equals(TARGET)) {
				ans = true;
				break;
			}

			for (String r : REP) {
				String _s = s.replace(TARGET, r);
				if (!_s.equals(s)) {
					queue.offer(_s);
				}
			}
		}

		System.out.println(ans ? "Yes" : "No");

	} //end main

	static String replace(String s, char r) {
		char[] ss = s.toCharArray();
		int count = 0;
		for (int i = 1; i < ss.length - 1; i++) {
			if (ss[i - 1] == 'A' && ss[i] == 'B' && ss[i + 1] == 'C') {
				ss[i] = r;
				ss[i - 1] = '_';
				ss[i + 1] = '_';
				count++;
			}
		}
		if (count == 0) {
			return s;
		}
		char[] _ss = new char[ss.length - count * 2];
		for (int i = 0, j = 0; i < ss.length; i++) {
			if (ss[i] != '_') {
				_ss[j] = ss[i];
				j++;
			}
		}
		return String.valueOf(_ss);
	}

}

Compiler output:
Main.java:1: error: package com.sun.org.apache.regexp.internal does not exist
import com.sun.org.apache.regexp.internal.RE;
                                         ^
1 error
Language: C++

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

using namespace std;

string s, S;
string op;

int main(void)
{
  cin >> s;
  S = s;

  while(1){
    string t; char c;
    if(s == "ABC"){
      break;
    }
    if(s.size() < 3){
      cout << "No" << endl;
      return 0;
    }
    bool head = (s.substr(0, 3) == "ABC");
    bool tail = (s.substr(s.size()-3) == "ABC");
    if(head && tail){
      cout << "No" << endl;
      return 0;
    }
    if(head) c = 'A';
    else if(tail) c = 'C';
    else c = 'B';
    op += c;

    for(int i = 0; i < s.size(); i++){
      if(s.substr(i, 3) == "ABC") t += c, i+=2;
      else t += s[i];
    }
    if(s == t){
      cout << "No" << endl;
      return 0;
    }
    s = t;
  }

  reverse(op.begin(), op.end());
  s = "ABC";
  for(int i = 0; i < op.size(); i++){
    string t;
    for(int j = 0; j < s.size(); j++){
      if(s[j] == op[i]) t += "ABC";
      else t += s[j];
    }
    s = t;
  }
  if(s == S)  cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}



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

#include<iostream>
#include<fstream>
#include<string>

#define fin cin

using std::cin;
using std::cout;
using std::endl;

std::string in{""};

int main()
{
	//std::ifstream fin("in.txt");
	fin >> in;

	if(in.size < 3){
		cout << "No" << endl;
		return 0;
	}
	
	int i = -1;
	while(true)
	{
		i++;
//		cout << i << " " << in.size() << " " << in << endl;
		if(i > in.size())break;

		if(//"ABC??¨????????????????????¢???"
			in[i]     == 'A' &&
			in[i + 1] == 'B' &&
			in[i + 2] == 'C'
		)
		{
			if(i + 5 < in.size())
			{
				if(//"ABC"???2??£?¶???????
					in[i + 3] == 'A' &&
					in[i + 4] == 'B' &&
					in[i + 5] == 'C'
				)
				{
					in.erase(in.begin() + i);
					in.erase(in.begin() + i);
					in.erase(in.begin() + i);
					in.erase(in.begin() + i);
					if(i == 0)in[i] = in[i + 1] = 'A';
					else if(in[i - 1] == 'C')in[i] = in[i + 1] = 'A';
					else if(in[i - 1] == 'A')in[i] = in[i + 1] = 'B';
					else if(in[i - 1] == 'B')in[i] = in[i + 1] = 'C';
					i = -1;
					continue;
				}
				in.erase(in.begin() + i);
				in.erase(in.begin() + i);
			}
			else 
			{
				in.erase(in.begin() + i);
				in.erase(in.begin() + i);		
			}
			//????????\?????????
			if(i == 0)in[i] = 'A';
			else if(in[i - 1] == 'C')in[i] = 'A';
			else if(in[i - 1] == 'A')in[i] = 'B';
			else if(in[i - 1] == 'B')in[i] = 'C';
			i = -1;
		}
	}
	cout << (in == "A" ? "Yes" : "No") << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   18 |         if(in.size < 3){
      |            ~~~^~~~
      |                   ()
Language: C++

#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
using namespace std;

bool dfs(string s){
    if(s == "ABC") return true;
    else if(s.find("ABC") == string::npos) return false;

    string ABC = "A";
    bool res = false;
    rep(i,3){
        string tmp = s;
        string::size_type pos = tmp.find("ABC");
        while(pos != string::npos){
            tmp.replace(pos, 3, ABC);
            pos = tmp.find("ABC", pos + 1);
            cnt++;
        }
        res |= dfs(tmp);
        ABC[0]++;
    }
    return res;
}

int main(){
    string s;
    cin >> s;
    if(s.size() % 2 == 0 && dfs(s)) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'bool dfs(std::string)':
a.cc:20:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   20 |             cnt++;
      |             ^~~
      |             int
Language: C++

#include "stdafx.h"
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)
#define RREP(i, a, n) for(int i=n-1; i>=a; i--)
#define INF 100000000
#define ll long long

queue<string> str;
int main()
{
	string S;
	vector<string> gene;
	cin >> S;
	
	gene.push_back("A");
	gene.push_back("B");
	gene.push_back("C");

	str.push(S);
	while (!str.empty()) {
		string s = str.front();
		str.pop();

		if (s.size() == 3 && s == "ABC") {
			cout << "Yes" << endl;
			return 0;
		}

		REP(i, 0, 3) {
			int t = 0;
			string ns = s;
			vector<int> idx;
			bool flag = false;

			RREP(j, 0, (int)s.size() - 2) {
				if (ns[j] == 'A' && ns[j + 1] == 'B' && ns[j + 2] == 'C') {
					flag = true;
					idx.push_back(j);
				}
			}

			REP(k, 0, (int)idx.size()) {
				ns.replace(idx[k], 3, gene[i]);
			}

			if(flag) str.push(ns);
		}
	}

	cout << "No" << endl;
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

//x -> "ABC"
string operate(string &s, char x) {
	string t;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == x) { t += "ABC"; }
		else { t += s[i]; }
	}
	return t;
}

//"ABC" -> x
string inverse(string &s, char x) {
	string t;
	for (int i = 0; i < s.length(); ) {
		if (i + 2 < s.length() && s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') {
			t += x;
			i += 3;
		}
		else {
			t += s[i];
			i++;
		}
	}
	return t;
}

//A,B,C?????¨?¨??????????????????????
bool check(string &s) {
	int cnt[3] = {0};
	for (int i = 0; i < s.length(); i++) {
		cnt[s[i] - 'A']++;
	}
	return (cnt[0] > 0 && cnt[1] > 0 && cnt[2] > 0);
}

int main() {
	string s;
	cin >> s;
	
	while (true) {
		if (!check(s)) { break; }
		if (s == "ABC") { cout << "Yes" << endl; return 0; }
		
		char last = 'z';
		for (char x = 'A'; x <= 'C'; x++) {
			if (operate(inverse(s, x), x) == s) {
				last = x;
				break;
			}
		}
		if (last == 'z') break;
		
		s = inverse(s, last);
	}
	
	cout << "No" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:44: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   50 |                         if (operate(inverse(s, x), x) == s) {
      |                                     ~~~~~~~^~~~~~
a.cc:6:24: note:   initializing argument 1 of 'std::string operate(std::string&, char)'
    6 | string operate(string &s, char x) {
      |                ~~~~~~~~^
Language: C++

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

//x -> "ABC"
string operate(string &s, char x) {
	string t;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == x) { t += "ABC"; }
		else { t += s[i]; }
	}
	return t;
}

//"ABC" -> x
string inverse(string &s, char x) {
	string t;
	for (int i = 0; i < s.length(); ) {
		if (i + 2 < s.length() && s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') {
			t += x;
			i += 3;
		}
		else {
			t += s[i];
			i++;
		}
	}
	return t;
}

//is all char appeared?
bool check(string &s) {
	int cnt[3] = {0};
	for (int i = 0; i < s.length(); i++) {
		cnt[s[i] - 'A']++;
	}
	return (cnt[0] > 0 && cnt[1] > 0 && cnt[2] > 0);
}

int main() {
	string s;
	cin >> s;
	
	while (true) {
		if (!check(s)) { break; }
		if (s == "ABC") { cout << "Yes" << endl; return 0; }
		
		char last = 'z';
		for (char x = 'A'; x <= 'C'; x++) {
			if (operate(inverse(s, x), x) == s) {
				last = x;
				break;
			}
		}
		if (last == 'z') break;
		
		s = inverse(s, last);
	}
	
	cout << "No" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:44: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   50 |                         if (operate(inverse(s, x), x) == s) {
      |                                     ~~~~~~~^~~~~~
a.cc:6:24: note:   initializing argument 1 of 'std::string operate(std::string&, char)'
    6 | string operate(string &s, char x) {
      |                ~~~~~~~~^
Language: C++

#include<iostream>
#include<string>
using namespace std;
bool t[5010];
bool DFS(string s){
	if(s=="ABC")return true;memset(t,0,s.size());
	for(int i=0;i<s.size()-2;i++)t[i]=(s.substr(i,3)=="ABC");
	string x[3]={"","",""};
	for(int i=0;i<s.size();i++){
		bool ok=t[i];
		if(i)ok|=t[i-1];
		if(i>1)ok|=t[i-2];
		for(int j=0;j<3;j++){
			if(!ok||j+'A'==s[i])x[j].push_back(s[i]);
		}
	}
	bool ok=false;
	for(int i=0;i<3;i++){
		if(x[i].size()<s.size())ok|=DFS(x[i]);
	}
	return ok;
}
int main(){
	string s;cin>>s;
	cout<<(DFS(s)?"Yes":"No")<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'bool DFS(std::string)':
a.cc:6:33: error: 'memset' was not declared in this scope
    6 |         if(s=="ABC")return true;memset(t,0,s.size());
      |                                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>