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

#include <iostream>
#include <vector>
#include <queue>

using namespace std;

typedef vector< vector<int> > graph;

class Node{
public:
	int p, v, prev; double cost;
	Node(int p, int v, int prev, double cost) : p(p), v(v), prev(prev), cost(cost) {}
	bool operator < (const Node &nd) const { return cost > nd.cost; }
};

int main(){
	int n, m, s, g;
	while(cin >> n >> m){
		if(!(n||m)) break;
		cin >> s >> g;
		graph gp(n);
		int dist[30][30];
		int limit[30][30];
		bool visit[30][31][30];
		memset(visit, false, sizeof(visit));
		for(int i=0;i<m;i++){
			int x, y, d, c;
			cin >> x >> y >> d >> c;
			gp[x-1].push_back(y-1);
			gp[y-1].push_back(x-1);
			dist[x-1][y-1] = d,  dist[y-1][x-1] = d;
			limit[x-1][y-1] = c, limit[y-1][x-1] = c;
		}
		priority_queue<Node> qu; qu.push(Node(s-1,0,s-1,0.0));
		double ans = -1.0;
		while(!qu.empty()){
			Node nd = qu.top(); qu.pop();
			int p = nd.p, v = nd.v, prev = nd.prev;
			if(visit[p][v][prev]) continue;
			visit[p][v][prev] = true;
			if(p==g-1 && v==1){
				ans = nd.cost;
				break;
			}
			for(int i=0;i<gp[p].size();i++){
				int next = gp[p][i];
				if(next==prev) continue;
				for(int j=-1;j<=1;j++){
					int nv = v+j;
					if(nv<=0||limit[p][next]<nv) continue;
					qu.push(Node(next,nv,p,nd.cost+(double)dist[p][next]/nv));
				}
			}
		}
		if(ans < 0.0) cout << "unreachable" << endl;
		else          printf("%.5f\n", ans);
	}
}

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

// 2009à\ID £UI¬x
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

typedef vector< vector<int> > graph;

class Node{
public:
	// p : »ÝÊu
	// v : »ÝÌXs[h
	// prev : OÉ¢½XÔ
	// cost : ±±ÜÅÌ£
	int p, v, prev; double cost;
	Node(int p, int v, int prev, double cost) : p(p), v(v), prev(prev), cost(cost) {}
	// priority_queueÅ¸\[gÉ·éÌªÊ|ÈÌÅCsðtÉè`µÄµÜ¤
	bool operator < (const Node &nd) const { return cost > nd.cost; }
};

int main(){
	int n, m, s, g;
	while(cin >> n >> m){
		if(!(n||m)) break;
		cin >> s >> g;
		graph gp(n);
		// £sñÆC§À¬xsñ(?)
		int dist[30][30];
		int limit[30][30];
		// óÔ(Êu, ¬x, OÌÊu)ª`FbNÏÝ©ð`FbN·éD
		bool visit[30][31][30];
		double len[30][31][30];
		memset(visit, false, sizeof(visit));
		for(int i=0;i<m;i++){
			int x, y, d, c;
			cin >> x >> y >> d >> c;
			gp[x-1].push_back(y-1);
			gp[y-1].push_back(x-1);
			dist[x-1][y-1] = d,  dist[y-1][x-1] = d;
			limit[x-1][y-1] = c, limit[y-1][x-1] = c;
		}
		for(int i=0;i<n;i++)
			for(int j=0;j<=30;j++)
				for(int k=0;k<n;k++) len[i][j][k] = 1e15;
		priority_queue<Node> qu; qu.push(Node(s-1,0,s-1,0.0));
		double ans = -1.0;
		// _CLXg@ÅÅZoH·ðßé
		while(!qu.empty()){
			Node nd = qu.top(); qu.pop();
			int p = nd.p, v = nd.v, prev = nd.prev;
			// `FbNÏÝÌóÔÈçcontinue
			if(visit[p][v][prev]) continue;
			visit[p][v][prev] = true;
			// S[óÔ
			if(p==g-1 && v==1){
				ans = nd.cost;
				break;
			}
			for(int i=0;i<gp[p].size();i++){
				int next = gp[p][i];
				// U^[ÍÖ~
				if(next==prev) continue;
				// ¬xðÆµ½èã°½è
				for(int j=-1;j<=1;j++){
					int nv = v+j;
					if(nv<=0||limit[p][next]<nv) continue;
					if(len[next][nv][p]-1e-8 > nd.cost+(double)dist[p][next]/nv){
						len[next][nv][p] = nd.cost+(double)dist[p][next]/nv;
						qu.push(Node(next,nv,p,len[next][nv][p]));
					}
				}
			}
		}
		if(ans < 0.0) cout << "unreachable" << endl;
		else          printf("%.5f\n", ans);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:17: error: 'memset' was not declared in this scope
   34 |                 memset(visit, false, sizeof(visit));
      |                 ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <queue>
  +++ |+#include <cstring>
    5 |
Language: C++

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

struct edge{
	int cost,limit;
	edge(int c,int l){
		cost=c;limit=l;
	}
};

#define INF 1000000

struct Node{
	int now,speed,before;
	double time;
	Node(int n,int s,double t,int bef){
		now=n;speed=s;time=t;before=bef;
	}
};

bool operator < (Node a,Node b){
	return a.time>b.time;
}

int n,m,s,g;

void solve(){
	vector<vector<edge> > E(n+1,vector<edge>(n+1,edge(-1,-1)));
	cin>>s>>g;
	for(int i=0;i<m;i++){
		int in,out,c,l;
		cin>>in>>out>>c>>l;
		E[in][out]=edge(c,l);
		E[out][in]=edge(c,l);
	}

	double Ans[31][31][31];
	memset(Ans,-1,sizeof(Ans));

	priority_queue<Node> Q;
	Q.push(Node(s,0,0.0,s));
	while(!Q.empty()){
		Node t=Q.top(); Q.pop();
		if(Ans[t.now][t.before][t.speed]<=t.time && Ans[t.now][t.before][t.speed]>=0) continue;
//		cout<<t.now<<" "<<t.speed<<" "<<t.time<<endl;
		if(t.now==g && t.speed==1){printf("%.12lf\n", t.time );  return;}
		Ans[t.now][t.before][t.speed]=t.time;

		for(int i=0;i<=n;i++){
			if(i==t.before) continue;
			if(E[t.now][i].cost>0){
				if(E[t.now][i].limit>=t.speed && t.speed>=1){
					Q.push(Node(i,t.speed,t.time+E[t.now][i].cost/(double)t.speed,t.now));
				}

				if(E[t.now][i].limit>=t.speed+1)
					Q.push(Node(i,t.speed+1,t.time+E[t.now][i].cost/(double)(t.speed+1.0),t.now));

				if(E[t.now][i].limit>=t.speed-1 && t.speed-1>=1)
					Q.push(Node(i,t.speed-1,t.time+E[t.now][i].cost/(double)(t.speed-1.0),t.now));
			}
		}
	}
	cout<<"unreachable"<<endl;
}

int main()
{
	while(cin>>n>>m && n!=0)
		solve();
	return 0;
}

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

#include<iostream>
#include<queue>
#include<vector>
#include<cmath>
#include<cstdio>
#include<map>
#define F first
#define S second
#define EPS 1e-10
#define INF 1<<29
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> PP;
typedef pair<double,int> dP;
typedef pair<P,dP> PPP;



int main(){
 
  while(true){
    scanf("%d %d",&n,&m);
    if(n+m == 0)break;
    vector<PP> matrix[40];    
    
 int inx,iny,ind,inc;
  double d[40][40][40];
  int n,m,s,g;
 

    scanf("%d %d",&s,&g);
    for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)for(int k=1;k<=30;k++)d[i][j][k] = INF;
    for(int i=0;i<m;i++){
      scanf("%d %d %d %d",&inx,&iny,&ind,&inc);
      matrix[inx].push_back(PP(P(iny,ind),inc));
      matrix[iny].push_back(PP(P(inx,ind),inc));
    }

    d[s][s][1] = 0;
    // PPP(P(now,prev),dP(cost,speed))
    priority_queue<PPP,vector<PPP>,greater<PPP> > que;
    que.push(PPP(P(s,0),dP(0.0,1)));

    double test = INF;
    int counter = 0;
    while(!que.empty()){
      PPP p = que.top();que.pop();
      if(p.S.F > d[p.F.F][p.F.S][p.S.S])continue;
     
      for(int i=0;i<matrix[p.F.F].size();i++){
	PP q = matrix[p.F.F][i];

	if(q.F.F == p.F.S || d[p.F.F][q.F.F][p.S.S] <= p.S.F+(double)q.F.S/(double)p.S.S || p.S.S > q.S)continue;
	if(d[p.F.F][q.F.F][p.S.S] > p.S.F+(double)q.F.S/(double)p.S.S && p.S.S <= q.S){  
	  if(q.F.F == g && p.S.S == 1){
	    d[p.F.F][q.F.F][p.S.S]=  d[q.F.F][p.F.F][p.S.S]  = p.S.F+(double)q.F.S/(double)p.S.S;
	    if(test > d[p.F.F][q.F.F][p.S.S])test = d[p.F.F][q.F.F][p.S.S];
	    //test = min(test, d[p.F.F][q.F.F][p.S.S]);
	  }    
	  else{	  
	    d[p.F.F][q.F.F][p.S.S] =  d[q.F.F][p.F.F][p.S.S]  = p.S.F + (double)q.F.S/(double)p.S.S;
	    if(d[p.F.F][q.F.F][p.S.S] <= d[q.F.F][p.F.F][p.S.S])que.push(PPP(P(q.F.F,p.F.F),dP(d[p.F.F][q.F.F][p.S.S],p.S.S)));
	    if(p.S.S+1<=30 && d[p.F.F][q.F.F][p.S.S] <= d[q.F.F][p.F.F][p.S.S+1])que.push(PPP(P(q.F.F,p.F.F),dP(d[p.F.F][q.F.F][p.S.S],p.S.S+1)));
	    if(p.S.S-1>=1 && d[p.F.F][q.F.F][p.S.S] <= d[q.F.F][p.F.F][p.S.S-1])que.push(PPP(P(q.F.F,p.F.F),dP(d[p.F.F][q.F.F][p.S.S],p.S.S-1)));
	  }
	}
      }

    }
 
    if(test != INF)printf("%.5f\n",test);
    else printf("unreachable\n");
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:20: error: 'n' was not declared in this scope; did you mean 'yn'?
   22 |     scanf("%d %d",&n,&m);
      |                    ^
      |                    yn
a.cc:22:23: error: 'm' was not declared in this scope; did you mean 'tm'?
   22 |     scanf("%d %d",&n,&m);
      |                       ^
      |                       tm
Language: C++

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<set>
#define INF 100000.0
using namespace std;
struct S{
	int town;
	int from;
	int v;
	double cost;
	void set(int a,int b,int c,double d){
		town=a;from=b;v=c;cost=d;
	}
	inline bool operator<(const S &a)const{
		return this->cost<a.cost;
	}
};
double dp[30][30][31];
int d[30][30];
int c[30][30];
multiset<S> Set;
multiset<S>::iterator it; 
int main(){	
	int n,m;
	int s,g;
	int x,y,t,u;
	double min;
	bool start;
	S a,b;
	while(cin>>n>>m,n||m){
		memset(d,-1,sizeof(d));
		memset(c,-1,sizeof(c));
		for(int i=0;i<n;i++)for(int j=0;j<30;j++)for(int k=1;k<31;k++)dp[i][j][k]=INF;
		cin>>s>>g;
		s--;g--;
		for(int i=0;i<m;i++){
			cin>>x>>y;
			x--;y--;
			cin>>t;
			d[y][x]=d[x][y]=t;
			cin>>t;
			c[y][x]=c[x][y]=t;
		}
		a.set(s,-1,1,0.0);
		Set.insert(a);
		start=true;
		while(!Set.empty()){
			it=Set.begin();
			a=*it;
			Set.erase(it);
			if(dp[a.town][a.from][a.v] < a.cost)continue;
			for(int i=0;i<n;i++){
				t=d[a.town][i];
				if(a.from==i || t==-1)continue;
				for(int j=-1;j<=1;j++){
					u=c[a.town][i];
					if(a.v+j<1 || a.v+j>u)continue;
					if(start && j!=0)continue;
					b.set(i,a.town,a.v+j,a.cost+(double)t/(a.v+j));
					if(b.cost < dp[b.town][b.from][b.v]){
						dp[b.town][b.from][b.v]= b.cost;
						Set.insert(b);
					}
				}
			}
			start=false;
		}
		min=INF;
		for(int i=0;i<n;i++)if(dp[g][i][1]<min)min=dp[g][i][1];
		if(min!=INF)printf("%.5f\n",min);//cout<<min<<endl;
		else cout<<"unreachable\n";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:17: error: 'memset' was not declared in this scope
   32 |                 memset(d,-1,sizeof(d));
      |                 ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<set>
  +++ |+#include <cstring>
    5 | #define INF 100000.0
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <climits>

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;

typedef vector<double> VD;
typedef vector<VD> VVD;
typedef vector<VVD> VVVD;

/*

Dijstra
頂点を拡張して属性を持たせる
ノード番号・直前の道・速度 := 時間
終点の速度 1の状態から min_element


元・行先・距離・制限速度

*/

struct Edge
{
	int to, dist, c;
	Edge( int t, int d, int c ) : to( t ), dist( d ), c( c ) {}
};

struct State
{
	int node, prev, speed;
	State( int n, int p, int s ) : node( n ), prev( p ), speed( s ) {}

	bool operator < ( const State &a ) const
	{
		return node < a.node;
	}
};

#include <iomanip>

int main()
{
	cout.precision( 4 );
	cout << fixed;

	while ( true )
	{
		int n, m;
		cin >> n >> m;

		if ( !( n | m ) )
		{
			break;
		}
		
		int s, g;
		cin >> s >> g;
		s--;
		g--;

		vector< vector<Edge> > G( n );
		for ( int i = 0; i < m; i++ )
		{
			int x, y, d, c;
			cin >> x >> y >> d >> c;
			x--;
			y--;

			G[x].push_back( Edge( y, d, c ) );
			G[y].push_back( Edge( x, d, c ) );
		}

		// 現在地・直前のノード・速度
		VVVD dist( n, VVD( n, VD( 101, DBL_MAX ) ) );
		dist[s][s][0] = 0;

		priority_queue< pair<double,State>, vector< pair<double,State> >, greater< pair<double,State> > > que;
		que.push( make_pair( 0, State( s, s, 0 ) ) );
		
		while ( !que.empty() )
		{
			double d = que.top().first;
			State cur = que.top().second;
			que.pop();

			if ( dist[ cur.node ][ cur.prev ][ cur.speed ] < d )
			{
				continue;
			}

			for ( int i = 0; i < G[ cur.node ].size(); i++ )
			{
				Edge &e = G[ cur.node ][i];

				if ( e.to == cur.prev )
				{
					continue;
				}

				for ( int ds = -1; ds <= 1; ds++ )
				{
					int nspeed = cur.speed + ds;

					if ( nspeed <= 0 || e.c < nspeed )
					{
						continue;
					}

					if ( dist[ cur.node ][ cur.prev ][ cur.speed ] + e.dist / (double)nspeed < dist[ e.to ][ cur.node ][ nspeed ] )
					{
						dist[ e.to ][ cur.node ][ nspeed ] = dist[ cur.node ][ cur.prev ][ cur.speed ] + e.dist / (double)nspeed;
						que.push( make_pair( dist[ e.to ][ cur.node ][ nspeed ], State( e.to, cur.node, nspeed ) ) );
					}
				}
			}
		}

		// 解候補：終点ノード・どこからでも・速度１
		double res = DBL_MAX;
		for ( int i = 0; i < n; i++ )
		{
			res = min( res, dist[g][i][1] );
		}

		if ( res == DBL_MAX )
		{
			cout << "unreachable" << endl;
		}
		else
		{
			cout << res << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:48: error: 'DBL_MAX' was not declared in this scope
   80 |                 VVVD dist( n, VVD( n, VD( 101, DBL_MAX ) ) );
      |                                                ^~~~~~~
a.cc:46:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
   45 | #include <iomanip>
  +++ |+#include <cfloat>
   46 |
Language: C++

#include<stdio.h>
#include<queue>
#include<algorithm>
using namespace std;
double ijk[30][31][31];
int v[30][31][31];
int g[30][30];
int lim[30][30];
int main(){
	int a,b;
	while(scanf("%d%d",&a,&b),a){
		int S,T;
		scanf("%d%d",&S,&T);
		S--;T--;
		for(int i=0;i<a;i++)
			for(int j=0;j<a;j++)
				g[i][j]=-1;
		for(int i=0;i<b;i++){
			int p,q,r,s;
			scanf("%d%d%d%d",&p,&q,&r,&s);
			p--;q--;
			g[p][q]=g[q][p]=r;
			lim[p][q]=lim[q][p]=s;
		}
		for(int i=0;i<a;i++)
			for(int j=0;j<31;j++)
			for(int k=0;k<31;k++){ijk[i][j][k]=99999999;v[i][j][k]=0;}
		priority_queue<pair<double,pair<pair<int,int>,int> > >Q;
		Q.push(make_pair(0,make_pair(make_pair(S,30),1)));
		ijk[S][30][1]=0;
		while(Q.size()){
			double cost=-Q.top().first;
			int at=Q.top().second.first.first;
			int prev=Q.top().xsecond.first.second;
			int ver=Q.top().second.second;
			Q.pop();
			if(~prev&&v[at][prev][ver])continue;
			if(~prev)v[at][prev][ver]=1;
			for(int i=0;i<a;i++){
				if(ver&&~g[at][i]&&lim[at][i]>=ver&&prev!=i){
					if(ijk[i][at][ver-1]>cost+(double)g[at][i]/ver){
						ijk[i][at][ver-1]=cost+(double)g[at][i]/ver;
						Q.push(make_pair(-ijk[i][at][ver-1],make_pair(make_pair(i,at),ver-1)));
					}
					if(ijk[i][at][ver]>cost+(double)g[at][i]/ver){
						ijk[i][at][ver]=cost+(double)g[at][i]/ver;
						Q.push(make_pair(-ijk[i][at][ver],make_pair(make_pair(i,at),ver)));
					}
					if(ver<30&&ijk[i][at][ver+1]>cost+(double)g[at][i]/ver){
						ijk[i][at][ver+1]=cost+(double)g[at][i]/ver;
						Q.push(make_pair(-ijk[i][at][ver+1],make_pair(make_pair(i,at),ver+1)));
					}
				}
			}
		}
		double ret=99999999;
		for(int i=0;i<a;i++)ret=min(ret,ijk[T][i][0]);
		if(ret>9999999)printf("unreachable\n");
		else printf("%f\n",ret);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:42: error: 'const __gnu_cxx::__alloc_traits<std::allocator<std::pair<double, std::pair<std::pair<int, int>, int> > >, std::pair<double, std::pair<std::pair<int, int>, int> > >::value_type' {aka 'const struct std::pair<double, std::pair<std::pair<int, int>, int> >'} has no member named 'xsecond'; did you mean 'second'?
   34 |                         int prev=Q.top().xsecond.first.second;
      |                                          ^~~~~~~
      |                                          second
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<set>
#include<string>
#include<map>
#include<cmath>
#include<queue>
#define P pair<int ,int>
using namespace std;

int spd[3] = {1, 0, -1};

struct E {
	int dst, cost, lim;
	E(int d, int c, int l) {
		dst = d;
		cost = c;
		lim = l;
	}
};

struct N {
	int pos, bef, spd;
	double ti;
	N(int p, int b, int s, double t) {
		pos = p;
		bef = b;
		spd = s;
		ti = t;
	}
	N(){}
};

bool operator < (N n1, N n2) {
	return n1.ti > n2.ti;
}

int main()
{
	int n, m, s, g;
	int x, y, d, c;
	N no;
	while (cin >> n >> m, n) {
		cin >> s >> g;
		bool ef = 0;
		bool f[31][31][31];
		memset(f, 0, sizeof(f));
		vector<vector<E> > e(n + 1);
		
		for (int i = 0; i < m; i++) {
			cin >> x >> y >> d >> c;
			e[x].push_back(E(y, d, c));
			e[y].push_back(E(x, d, c));
		}
		
		priority_queue<N> pq;
		pq.push(N(s, s, 0, 0));
		
		while (!pq.empty()) {
			no = pq.top();
			pq.pop();
			if (f[no.pos][no.bef][no.spd]) continue;
			f[no.pos][no.bef][no.spd] = 1;
			
			if (no.pos == g && no.spd == 1) {
				ef = 1;
				break;
			}
			
			for (int i = 0; i < e[no.pos].size(); i++) {
				if (no.bef == e[no.pos][i].dst) continue;
				
				for (int j = 0; j < 3; j++) {
					if (no.spd + spd[j] > 0 && e[no.pos][i].lim >= no.spd + spd[j])
						pq.push(N(e[no.pos][i].dst, no.pos, no.spd + spd[j], no.ti + e[no.pos][i].cost / (double)(no.spd + spd[j])));
				}
			}
		}
		
		if(ef) printf("%.5lf\n", no.ti);
		else cout << "unreachable" << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:17: error: 'memset' was not declared in this scope
   48 |                 memset(f, 0, sizeof(f));
      |                 ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include<queue>
  +++ |+#include <cstring>
    9 | #define P pair<int ,int>
Language: C

#include <iostream>
#include <vector>
#include <cstdlib>
#define SIZE 1000

using namespace std;

int m, n, b[501], r[501];
int match[SIZE];
bool used[SIZE];
vector<int> G[SIZE];

bool dfs(int v){
	used[v]=1;
	for(int i=0; i<G[v].size(); i++){
		int u=G[v][i], w=match[u];
		if(w<0||!used[w]&&dfs(w)){
			match[v]=u, match[u]=v;
			return 1;
		}
	}
	return 0;
}

void solve(){
	int res=0;
	memset(match, -1, sizeof(match));
	for(int v=0; v<m+n; v++){
		if(match[v]<0){
			memset(used, 0, sizeof(used));
			if(dfs(v)) res++;
		}
	}
	cout<<res<<endl;
}

int main(){
	while(1){
		cin >> n >> m;
		if(!n && !m) break;
		for(int i=0; i<n; i++){
			cin >> b[i];
		}
		for(int i=0; i<m; i++){
			cin >> r[i];
		}
		for(int i=0; i<SIZE; i++) G[i].clear;
		for(int i=0; i<n; i++){
			for(int j=0; j<m; j++){
				int a=b[i], c=r[j];
				while(c){
					a%=c;
					swap(a, c);
				}
				if(a!=1)G[i].push_back(j+n), G[n+j].push_back(i);
			}
		}
		solve();
	}
}


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

#include <iostream>
#include <vector>
#include <cstring>
#define SIZE 1000

using namespace std;

int m, n, b[501], r[501];
int match[SIZE];
bool used[SIZE];
vector<int> G[SIZE];

bool dfs(int v){
	used[v]=1;
	for(int i=0; i<G[v].size(); i++){
		int u=G[v][i], w=match[u];
		if(w<0||!used[w]&&dfs(w)){
			match[v]=u, match[u]=v;
			return 1;
		}
	}
	return 0;
}

void solve(){
	int res=0;
	memset(match, -1, sizeof(match));
	for(int v=0; v<m+n; v++){
		if(match[v]<0){
			memset(used, 0, sizeof(used));
			if(dfs(v)) res++;
		}
	}
	cout<<res<<endl;
}

int main(){
	while(1){
		cin >> n >> m;
		if(!n && !m) break;
		for(int i=0; i<n; i++){
			cin >> b[i];
		}
		for(int i=0; i<m; i++){
			cin >> r[i];
		}
		for(int i=0; i<SIZE; i++) G[i].clear();
		for(int i=0; i<n; i++){
			for(int j=0; j<m; j++){
				int a=b[i], c=r[j];
				while(c){
					a%=c;
					swap(a, c);
				}
				if(a!=1)G[i].push_back(j+n), G[n+j].push_back(i);
			}
		}
		solve();
	}
}


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

#include <iostream>
#include <vector>
#define SIZE 1000

using namespace std;

int m, n, b[501], r[501];
int match[SIZE];
bool used[SIZE];
vector<int> G[SIZE];

bool dfs(int v){
	used[v]=1;
	for(int i=0; i<G[v].size(); i++){
		int u=G[v][i], w=match[u];
		if(w<0||!used[w]&&dfs(w)){
			match[v]=u, match[u]=v;
			return 1;
		}
	}
	return 0;
}

void solve(){
	int res=0;
	memset(match, -1, sizeof(match));
	for(int v=0; v<m+n; v++){
		if(match[v]<0){
			memset(used, 0, sizeof(used));
			if(dfs(v)) res++;
		}
	}
	cout<<res<<endl;
}

int main(){
	while(1){
		cin >> n >> m;
		if(!n && !m) break;
		for(int i=0; i<n; i++){
			cin >> b[i];
		}
		for(int i=0; i<m; i++){
			cin >> r[i];
		}
		for(int i=0; i<SIZE; i++) G[i].clear;
		for(int i=0; i<n; i++){
			for(int j=0; j<m; j++){
				int a=b[i], c=r[j];
				while(c){
					a%=c;
					swap(a, c);
				}
				if(a!=1)G[i].push_back(j+n), G[n+j].push_back(i);
			}
		}
		solve();
	}
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:26:9: error: 'memset' was not declared in this scope
   26 |         memset(match, -1, sizeof(match));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | #define SIZE 1000
a.cc: In function 'int main()':
a.cc:46:48: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::clear() [with _Tp = int; _Alloc = std::allocator<int>]'
   46 |                 for(int i=0; i<SIZE; i++) G[i].clear;
      |                                           ~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1607:7: note: declared here
 1607 |       clear() _GLIBCXX_NOEXCEPT
      |       ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cstdlib>
#define SIZE 1000

using namespace std;

int m, n, b[501], r[501];
int match[SIZE];
bool used[SIZE];
vector<int> G[SIZE];

bool dfs(int v){
	used[v]=1;
	for(int i=0; i<G[v].size(); i++){
		int u=G[v][i], w=match[u];
		if(w<0||!used[w]&&dfs(w)){
			match[v]=u, match[u]=v;
			return 1;
		}
	}
	return 0;
}

void solve(){
	int res=0;
	memset(match, -1, sizeof(match));
	for(int v=0; v<m+n; v++){
		if(match[v]<0){
			memset(used, 0, sizeof(used));
			if(dfs(v)) res++;
		}
	}
	cout<<res<<endl;
}

int main(){
	while(1){
		cin >> n >> m;
		if(!n && !m) break;
		for(int i=0; i<n; i++){
			cin >> b[i];
		}
		for(int i=0; i<m; i++){
			cin >> r[i];
		}
		for(int i=0; i<SIZE; i++) G[i].clear;
		for(int i=0; i<n; i++){
			for(int j=0; j<m; j++){
				int a=b[i], c=r[j];
				while(c){
					a%=c;
					swap(a, c);
				}
				if(a!=1)G[i].push_back(j+n), G[n+j].push_back(i);
			}
		}
		solve();
	}
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:27:9: error: 'memset' was not declared in this scope
   27 |         memset(match, -1, sizeof(match));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <cstdlib>
  +++ |+#include <cstring>
    4 | #define SIZE 1000
a.cc: In function 'int main()':
a.cc:47:48: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::clear() [with _Tp = int; _Alloc = std::allocator<int>]'
   47 |                 for(int i=0; i<SIZE; i++) G[i].clear;
      |                                           ~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1607:7: note: declared here
 1607 |       clear() _GLIBCXX_NOEXCEPT
      |       ^~~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<functional>
#define rep(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define MaxCards 1000
using namespace std;
int	b,r,V;
int blue[MaxCards],red[MaxCards];
vector<int> G[MaxCards];
int match[MaxCards]; // マッチングのペア
bool used[MaxCards]; // DFSですでに調べたかのフラグ


// uからvを結ぶ辺をグラフに追加する
void add_edge(int u, int v) {
    G[u].push_back(v);
    G[v].push_back(u);
}

// 増加パスをDFSで探す
bool dfs(int v) {
    used[v] = true;
    for(int i=0;i<G[v].size();i++) {
        int u = G[v][i], w = match[u];
        if (w < 0 || !used[w] && dfs(w)) {
            match[v] = u;
            match[u] = v;
            return true;
        }
    }
    return false;
}

// 二部グラフの最大マッチングを求める
int bipartite_matching() {
    int res = 0;
    memset(match, -1, sizeof(match));
    for(int v = 0; v < V; v++) {
        if (match[v] < 0) {
            memset(used, 0, sizeof(used));
            if (dfs(v)) {
                res++;
            }
        }
    }
    return res;
}
int gcd(int n1,int n2){
	if(n1%n2==0) return n2;
	return gcd(n2,n1%n2);
}
int main(){

	while(true){
		memset(blue,0,sizeof(blue));
		memset(red,0,sizeof(red));
		for(int i=0;i<MaxCards;i++){
			G[i].clear();
		}
		cin>>b>>r;
		V=b+r;
		if(b==0)
			break;
		int idx=0;
		for(int i=0;i<b;i++){
			cin >> blue[i];
		}
		for(int i=0;i<r;i++){
			cin >> red[i];
		}
		for(int i=0;i<b;i++){
			for(int j=0;j<r;j++){
				if(blue[i]>red[j]){
					if(gcd(blue[i],red[j])!=1){
						add_edge(i,b+j);
					}
				}
				else if(gcd(red[j],blue[i])!=1){
					add_edge(i,b+j);
				}		
			}
		}
		cout << bipartite_matching() << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int bipartite_matching()':
a.cc:39:5: error: 'memset' was not declared in this scope
   39 |     memset(match, -1, sizeof(match));
      |     ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<functional>
  +++ |+#include <cstring>
    6 | #define rep(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
a.cc: In function 'int main()':
a.cc:57:17: error: 'memset' was not declared in this scope
   57 |                 memset(blue,0,sizeof(blue));
      |                 ^~~~~~
a.cc:57:17: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<functional>
#define rep(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define MaxCards 1000
using namespace std;
int	b,r,V;
int blue[MaxCards],red[MaxCards];
vector<int> G[MaxCards];
int match[MaxCards]; 
bool used[MaxCards];



void add_edge(int u, int v) {
    G[u].push_back(v);
    G[v].push_back(u);
}

// 増加パスをDFSで探す
bool dfs(int v) {
    used[v] = true;
    for(int i=0;i<G[v].size();i++) {
        int u = G[v][i], w = match[u];
        if (w < 0 || !used[w] && dfs(w)) {
            match[v] = u;
            match[u] = v;
            return true;
        }
    }
    return false;
}

int bipartite_matching() {
    int res = 0;
    memset(match, -1, sizeof(match));
    for(int v = 0; v < V; v++) {
        if (match[v] < 0) {
            memset(used, 0, sizeof(used));
            if (dfs(v)) {
                res++;
            }
        }
    }
    return res;
}
int gcd(int n1,int n2){
	if(n1%n2==0) return n2;
	return gcd(n2,n1%n2);
}
int main(){

	while(true){
		memset(blue,0,sizeof(blue));
		memset(red,0,sizeof(red));
		for(int i=0;i<MaxCards;i++){
			G[i].clear();
		}
		cin>>b>>r;
		V=b+r;
		if(b==0)
			break;
		int idx=0;
		for(int i=0;i<b;i++){
			cin >> blue[i];
		}
		for(int i=0;i<r;i++){
			cin >> red[i];
		}
		for(int i=0;i<b;i++){
			for(int j=0;j<r;j++){
				if(blue[i]>red[j]){
					if(gcd(blue[i],red[j])!=1){
						add_edge(i,b+j);
					}
				}
				else if(gcd(red[j],blue[i])!=1){
					add_edge(i,b+j);
				}		
			}
		}
		cout << bipartite_matching() << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int bipartite_matching()':
a.cc:38:5: error: 'memset' was not declared in this scope
   38 |     memset(match, -1, sizeof(match));
      |     ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<functional>
  +++ |+#include <cstring>
    6 | #define rep(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
a.cc: In function 'int main()':
a.cc:56:17: error: 'memset' was not declared in this scope
   56 |                 memset(blue,0,sizeof(blue));
      |                 ^~~~~~
a.cc:56:17: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <cmath>
#include <algorithm>
#include <functional>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define rep1(i,n) for(int i=1;i<=(n);++i)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl;
const int MAX_V=1000;
int V;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];
int gcd(int a,int b){
	if(a>b) swap(a,b);
	if(a==0) return b;
	return gcd(b%a,a);
}
void add_edge(int u,int v){
	G[u].push_back(v);
	G[v].push_back(u);
}
bool dfs(int v){
	used[v]=true;
	rep(i,G[v].size()){
		int u=G[v][i],w=match[u];
		if(w<0 || (!used[w] && dfs(w))){
			match[v]=u;
			match[u]=v;
			return true;
		}
	}
	return false;
}
int nibu(){
	int res=0;
	memset(match,-1,sizeof(match));
	rep(v,V){
		if(match[v]<0){
			memset(used,0,sizeof(used));
			if(dfs(v)) res++;
		}
	}
	return res;
}
int main(){
	while(true){
		int m,n,b[500],r[500];
		cin>>m>>n;
		if(m==0) break;
		rep(i,m) cin >> b[i];
		rep(i,n) cin >> r[i];
		V=m+n;
		rep(i,V) G[i].clear();
		rep(i,m) rep(j,n) if(gcd(b[i],r[j])>1) add_edge(i,j+m);
		cout << nibu() << endl;
	}
}

Compiler output:
a.cc: In function 'int nibu()':
a.cc:44:9: error: 'memset' was not declared in this scope
   44 |         memset(match,-1,sizeof(match));
      |         ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <functional>
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

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

const int INF=1000;
struct edge{
    int to,cap,rev;
};
vector<edge> graph[1010];
bool used[1010];
void add_edge(int from,int to,int cap){
    graph[from].push_back((edge){to,cap,static_cast<int>(graph[to].size())});
    graph[to].push_back((edge){from,0,static_cast<int>(graph[from].size()-1)});
}
int dfs(int at,int t,int f){
    if(at==t) return f;
    used[at]=true;
    for(int i=0;i<graph[at].size();i++){
        edge &now=graph[at][i];
        if(!used[now.to] && now.cap>0){
            int d=dfs(now.to,t,min(f,now.cap));
            if(d>0){
                now.cap-=d;
                graph[now.to][now.rev].cap+=d;
                return d;
            }
        }
    }
    return 0;
}
int max_flow(int s,int t,int V){
    int flow=0;
    for(;;){
        for(int i=0;i<V;i++){
            used[i]=false;
        }
        int f=dfs(s,t,INF);
        if(f==0) return flow;
        flow+=f;
    }
}

int b[510],r[510];
int main(){
    int m,n;
    for(;;){
        scanf("%d%d",&m,&n);
        if(m==0 && n==0) break;
        fill(graph,graph+m+n+2,vector<edge>());
        for(int i=0;i<m;i++){
            add_edge(m+n,i,1);
            scanf("%d",&b[i]);
        }
        for(int i=0;i<n;i++){
            add_edge(i+m,m+n+1,1);
            scanf("%d",&r[i]);
        }
        for(int i=0;i<m;i++){
            for(int j=0;j<n;j++){
                if(__gcd(b[i],r[j])>1) add_edge(i,j+m,1);
            }
        }
        printf("%d\n",max_flow(m+n,m+n+1,m+n+2));
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:20: error: '__gcd' was not declared in this scope; did you mean '__gid_t'?
   60 |                 if(__gcd(b[i],r[j])>1) add_edge(i,j+m,1);
      |                    ^~~~~
      |                    __gid_t
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#define MAX_V 500*500+1
#define INF 501

using namespace std;



struct edge{int to,cap,rev;};

vector<edge> G[MAX_V];
bool used[MAX_V];

void add_edge(int from,int to,int cap){
  G[from].push_back((edge){to,cap,G[to].size()});
  G[to].push_back((edge){from,0,G[from].size()-1});
}

int dfs(int v,int t,int f){
  if(v==t)return f;
  used[v]=true;

  for(int i=0;i<G[v].size();i++){
    edge &e = G[v][i];
    if(!used[e.to] && e.cap > 0){
      int d=dfs(e.to,t,min(f,e.cap));
      if(d>0){
	e.cap-=d;
	G[e.to][e.rev].cap+=d;
	return d;
      }
    }
  }
  return 0;
}

int max_flow(int s,int t){
  int flow=0;
  for(;;){
    memset(used,0,sizeof(used));
    int f=dfs(s,t,INF);
    if(f==0)return flow;
    flow+=f;
  }
}

int lcm(int m,int n){
  int tmp;
  while (m % n != 0)
    {
      tmp = n;
      n = m % n;
      m = tmp;
    }
  return n;
}



int main()
{
  for(;;){
    for(int i=0;i<MAX_V;i++){
      G[i].clear();
    }
    int m,n;
    cin >> m >> n;
    if(m==0)return 0;
    int br[m+n];
    for(int i=0;i<m+n;i++)cin >> br[i];

    for(int i=0;i<m;i++){
      for(int j=m;j<m+n;j++){
	//cout << br[i] << "," << br[j]<< ";" << lcm(br[i],br[j]) <<endl;
	if(lcm(br[i],br[j])!=1){
	  add_edge(i,j,1);
	}
      }
    }
    for(int i=0;i<m;i++)
      add_edge(n+m+1,i,1);
 
    for(int i=0;i<n;i++)
      add_edge(m+i,n+m+2,1);

    cout << max_flow(n+m+1,n+m+2) << endl;
  }
}

      

Compiler output:
a.cc: In function 'void add_edge(int, int, int)':
a.cc:17:45: warning: narrowing conversion of 'G[to].std::vector<edge>::size()' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
   17 |   G[from].push_back((edge){to,cap,G[to].size()});
      |                                   ~~~~~~~~~~^~
a.cc:18:47: warning: narrowing conversion of '(G[from].std::vector<edge>::size() - 1)' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
   18 |   G[to].push_back((edge){from,0,G[from].size()-1});
      |                                 ~~~~~~~~~~~~~~^~
a.cc: In function 'int max_flow(int, int)':
a.cc:42:5: error: 'memset' was not declared in this scope
   42 |     memset(used,0,sizeof(used));
      |     ^~~~~~
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 | #define MAX_V 500*500+1
Language: C++

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

//Class.
vector<int> list[100000];
int N, M, E;
int match[100000];
bool used[100000];
int x[10000], y[10000];

bool DFS(int V) {
	used[V] = true;
	for (int i = 0; i < list[V].size(); i++) {
		int u = list[V][i]; int w = match[u];
		if (w < 0 || !used[w] && DFS(w)) {
			match[V] = u;
			match[u] = V;
			return true;
		}
	}
	return false;
}

int supermatching() {
	int r = 0;
	memset(match, -1, sizeof(match));
	for (int j = 0; j < N + M; j++) {
		if (match[j] < 0) {
			memset(used, 0, sizeof(used));
			if (DFS(j)) { r++; }
		}
	}
	return r;
}

//main.
int main() {
	cin >> N >> M;
	for (int i = 0; i < N; i++) {
		cin >> x[i];
	}
	for (int i = 0; i < M; i++) {
		cin >> y[i];
	}
	for (int i = 0; i < M; i++) {
		for (int j = 0; j < N; j++) {
			if (__gcd(N, M) != 1) {
				list[i].push_back(j);
			}
		}
	}
	cout << supermatching() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:29: error: '__gcd' was not declared in this scope
   49 |                         if (__gcd(N, M) != 1) {
      |                             ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
vector<int>L[1000];int N,M,E,i,jmatch[1000],x[1000],y[1000];bool used[1000];
bool DFS(int V){
	used[V]=true;
	for(i=0;i<L[V].size();i++){
		int u=L[V][i],w=match[u];
		if(w<0||!used[w]&&DFS(w)){
			match[V]=u;
			match[u]=V;
			return 1;
		}
	}
	return 0;
}
int SM(){
	int r=0;
	memset(match,-1,sizeof(match));
	for(j=0;j<N+M;j++){
		if(match[j]<0){
			memset(used,0,sizeof(used));
			if(DFS(j)){r++;}
		}
	}
	return r;
}
int main(){
	while(1){
		for(i=0;i<1000;i++){L[i].clear();}
		cin>>N>>M;if(!N){break;}
		for(i=0;i<N;i++){
			cin>>x[i];
		}
		for(i=0;i<M;i++){
			cin>>y[i];
		}
		for(i=0;i<N;i++){
			for(j=0;j<M;j++){
				if(__gcd(x[i],y[j])>1){
					L[i].push_back(j+N);
				}
			}
		}
		cout<<SM()<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'bool DFS(int)':
a.cc:7:33: error: 'match' was not declared in this scope; did you mean 'jmatch'?
    7 |                 int u=L[V][i],w=match[u];
      |                                 ^~~~~
      |                                 jmatch
a.cc: In function 'int SM()':
a.cc:18:16: error: 'match' was not declared in this scope; did you mean 'jmatch'?
   18 |         memset(match,-1,sizeof(match));
      |                ^~~~~
      |                jmatch
a.cc:19:13: error: 'j' was not declared in this scope
   19 |         for(j=0;j<N+M;j++){
      |             ^
a.cc: In function 'int main()':
a.cc:38:29: error: 'j' was not declared in this scope
   38 |                         for(j=0;j<M;j++){
      |                             ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int gcd(int x,int y){
    if(x % y == 0){
        return y;
    }
    return gcd(y,x%y);
}

bool match(int x){
    if(x == -1){
        return 1;
    }
    for(int i = 0;i < n;i++){
        if(c[x][i] == 1 && v[i] == 0){
            v[i] = 1;
            if(match(redpair[i])){
                redpair[i] = x;
                return 1;
            }
        }
    }
    return 0;
}


int main(){
    vector<int> blue;
    vector<int> red;
    vector<int> redpair;
    vector<int> v;
    vector<vector<int> > c;

    int m = 0;
    int n = 0;

    while(cin >> m >> n){
        if(m == 0 && n == 0){
            break;
        }
        blue.clear();
        red.clear();
        redpair.clear();
        v.clear();
        c.clear();
        for(int i = 0;i < m;i++){
            int tmp = 0;
            cin >> tmp;
            blue.push_back(tmp);
        }
        for(int i = 0;i < n;i++){
            int tmp = 0;
            cin >> tmp;
            red.push_back(tmp);
            redpair.push_back(-1);
            v.push_back(0);
        }
        for(int i = 0;i < m;i++){
            c.push_back(vector<int>());
            for(int j = 0;j < n;j++){
                c[i].push_back(gcd(blue[i],red[j]) != 1);
            }
        }
        int ans = 0;
        for(int i = 0;i < m;i++){
            for(int j = 0;j < n;j++){
                v[j] = 0;
            }
            if(match(i)){ans++;}
        }
        cout << ans << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'bool match(int)':
a.cc:17:23: error: 'n' was not declared in this scope
   17 |     for(int i = 0;i < n;i++){
      |                       ^
a.cc:18:12: error: 'c' was not declared in this scope
   18 |         if(c[x][i] == 1 && v[i] == 0){
      |            ^
a.cc:18:28: error: 'v' was not declared in this scope
   18 |         if(c[x][i] == 1 && v[i] == 0){
      |                            ^
a.cc:20:22: error: 'redpair' was not declared in this scope
   20 |             if(match(redpair[i])){
      |                      ^~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

#define rep(i,n) for(int i = 0;i < n;i++)
#define clr(n)	memset(n,0,sizeof(n));
const int INF = 1e9;

int gcd(int a, int b) {
	return b ? gcd(b, a%b) : a; 
}

struct edge { int to, cap, rev; };
vector<edge> G[1001];
bool used[1001];

void clear() {
	rep(i, 1001) {
		G[i].clear();
		used[i] = false;
	}
}

void add_edge(int from, int to, int cap) {
	G[from].push_back(edge{ to, cap, int(G[to].size()) });
	G[to].push_back(edge{ from, 0, int(G[from].size()) - 1 });
}

int dfs(int v, int t, int f) {
	if (v == t)return f;
	used[v] = true;
	rep(i, G[v].size()) {
		edge &e = G[v][i];
		if (!used[e.to] && e.cap > 0) {
			int d = dfs(e.to, t, min(f, e.cap));
			if (d > 0) {
				e.cap -= d;
				G[e.to][e.rev].cap += d;
				return d;
			}
		}
	}
	return 0;
}
int max_flow(int s, int t) {
	int flow = 0;
	for (;;) {
		clr(used);
		int f = dfs(s, t, INF);
		if (f == 0)return flow;
		flow += f;
	}
}

int main() {
	int m, n;

	while (cin >> m >> n && m) {
		vector<int> r(m), b(n);
		clear();
		rep(i, m) {
			cin >> r[i];
			add_edge(m + n, i, 1);
		}
		rep(i, n) {
			cin >> b[i];
			add_edge( m + i, m + n + 1, 1);
		}
		rep(i, m)rep(j, n) {
			if (gcd(r[i], b[j]) != 1) {
				add_edge(i, m + j, 1);
			}
		}

		cout << max_flow(m + n, m + n + 1) << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int max_flow(int, int)':
a.cc:8:17: error: 'memset' was not declared in this scope
    8 | #define clr(n)  memset(n,0,sizeof(n));
      |                 ^~~~~~
a.cc:50:17: note: in expansion of macro 'clr'
   50 |                 clr(used);
      |                 ^~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 |
Language: C++

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#define X first
#define Y second

using namespace std;

struct link{
	int dest;
	link *ne;
	link(int n=0){
		dest=n;
		ne=NULL;
	}
};

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

int n, m, a[510], b[510], used[510], ans;
link *last[510], *t;

bool dfs(int x){
	link *t=last[x];
	while(t){
		if(!used[t->dest]){
			used[t->dest]=1;
			if(b[t->dest]==0||dfs(b[t->dest])){
				b[t->dest]=x;
				return true;
			}
		}
		t=t->ne;
	}
	return false;
}

int main() {
	cin>>n>>m;
	while(n+m>0){
		ans=0;
		for(int i=1;i<=n;i++) cin>>a[i];
		for(int i=1;i<=m;i++) cin>>b[i];
		for(int i=1;i<=n;i++)
			for(int j=1;j<=m;j++)
				if(gcd(a[i],b[j])>1){
					t=new link(j);
					t->ne=last[i];
					last[i]=t;
				}
		memset(b,0,sizeof(b));
		for(int i=1;i<=n;i++){
			memset(used,0,sizeof(used));
			if(dfs(i)) ans++;
		}
		cout<<ans<<endl;
		for(int i=1;i<=n;i++){
			t=last[i];
			while(last[i]){
				t=last[i]->ne;
				delete last[i];
				last[i]=t;
			}
		}
		cin>>n>>m;			
	}
	return 0;
}
&#171; Back

Compiler output:
a.cc:78:2: error: stray '#' in program
   78 | &#171; Back
      |  ^
a.cc:78:3: error: expected unqualified-id before numeric constant
   78 | &#171; Back
      |   ^~~
a.cc:78:8: error: 'Back' does not name a type
   78 | &#171; Back
      |        ^~~~
Language: C++

#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <functional>

using namespace std;

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

typedef long long ll;

class path {
public:
  int t;
  ll c;
  int p;
};

class dinic {
public:
  int n;
  vector<path> p;
  vector<int>* v;
  int* l;
  int* o;
  dinic(int nw) {
    n = nw;
    v = new vector<int>[n];
    l = new int[n];
    o = new int[n];
  }
  void add(int from, int to, ll cap) {
    path w1, w2;
    w1.t = to;
    w1.c = cap;
    w1.p = p.size() + 1;
    v[from].push_back(p.size());
    w2.t = from;
    w2.c = 0;
    w2.p = p.size();
    v[to].push_back(p.size() + 1);
    p.push_back(w1);
    p.push_back(w2);
  }
  void dics(int from) {
    rep(i, n) {
      l[i] = inf;
    }
    priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > pq;
    pq.push(make_pair(0, from));
    while(!pq.empty()) {
      int k = pq.top().first;
      int m = pq.top().second;
      pq.pop();
      if(l[m] > k) {
        l[m] = k;
        rep(i, v[m].size()) {
          int x = v[m][i];
          if(p[x].c > 0) {
            pq.push(make_pair(k + 1, p[x].t));
          }
        }
      }
    }
  }
  ll dfs(int now, int to, ll mi) {
    if(now == to) {
      return mi;
    }
    ll all = 0;
    while(o[now] < v[now].size()) {
      int x = v[now][o[now]];
      ll w = dfs(p[x].t, min(mi - all, p[x].c));
      p[x].c -= w;
      p[p[x].p].c += w;
      all += w;
      if(mi - all == 0) {
        break;
      }
      o[now]++;
    }
    return all;
  }
  ll solve(int from, int to) {
    ll all = 0;
    while(1) {
      dics(from);
      rep(i, n) {
        o[i] = 0;
      }
      int w = dfs(from, to, inf);
      all += w;
      if(w == 0) {
        break;
      }
    }
    return all;
  }
  ~dinic() {
    delete[] v;
    delete[] l;
    delete[] o;
  }
};

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

ll nd[1000], md[1000];

int main() {
  while(1) {
    int n, m;
    scanf("%d%d",&n,&m);
    if(n == 0) {
      break;
    }
    rep(i, n) {
      scanf("%lld", nd + i);
    }
    rep(i, m) {
      scanf("%lld", md + i);
    }
    dinic s(2 + n + m);
    rep(i, n) {
      s.add(n + m, i, 1);
    }
    rep(i, m) {
      s.add(n + i, n + m + 1, 1);
    }
    rep(i, n) {
      rep(j, m) {
        if(gcd(nd[i], md[j]) > 1) {
          s.add(i, n + j, 1);
        }
      }
    }
    printf("%lld\n", s.solve(n + m, n + m + 1));
  }
}

Compiler output:
a.cc: In member function 'll dinic::dfs(int, int, ll)':
a.cc:75:17: error: no matching function for call to 'dinic::dfs(int&, const long long int&)'
   75 |       ll w = dfs(p[x].t, min(mi - all, p[x].c));
      |              ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:68:6: note: candidate: 'll dinic::dfs(int, int, ll)'
   68 |   ll dfs(int now, int to, ll mi) {
      |      ^~~
a.cc:68:6: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <iostream>
#include <vector>

using namespace std;
using ll = long long;

/**
 * ?????¨?????§??????????????°
 *
 * O(EV)
 */
template<int V>
struct BitMatching {
    vector<int> G[2*V];
    int match[2*V];
    bool used[2*V];
    /// ?????????
    void init() {
        for (int i = 0; i < 2*V; i++) {
            G[i].clear();
        }
    }
    /// ?????´???a????????¨?????´???b?????????????????????
    void add(int a, int b) {
        G[a].push_back(b+V);
        G[b+V].push_back(a);
    }

    bool dfs(int v) {
        used[v] = true;
        for (int i = 0; i < G[v].size(); i++) {
            int u = G[v][i], w = match[u];
            if (w < 0 || (!used[w] && dfs(w))) {
                match[v] = u;
                match[u] = v;
                return true;
            }
        }
        return false;
    }
    /// ?????§??????????????°?????¬??°???????????????
    int exec() {
        int res = 0;
        memset(match, -1, sizeof(match));
        for (int v = 0; v < V; v++) {
            if (match[v] < 0) {
                memset(used, 0, sizeof(used));
                if (dfs(v)) {
                    res++;
                }
            }
        }
        return res;
    }
};

const int MN = 520;
BitMatching<MN> bm;
ll gcd(ll a, ll b) {
    if (b == 0) return a;
    return gcd(b, a%b);
}
int main() {
    while (true) {
        int n, m;
        cin >> n >> m;
        if (!n) break;
        bm.init();
        int a[n], b[m];
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }
        for (int i = 0; i < m; i++) {
            cin >> b[i];
        }

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (gcd(a[i], b[j]) != 1) {
                    bm.add(i, j);
                }
            }
        }
        cout << bm.exec() << endl;
    }
    return 0;
}

Compiler output:
a.cc: In instantiation of 'int BitMatching<V>::exec() [with int V = 520]':
a.cc:84:24:   required from here
   84 |         cout << bm.exec() << endl;
      |                 ~~~~~~~^~
a.cc:44:15: error: 'memset' was not declared in this scope
   44 |         memset(match, -1, sizeof(match));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | 
a.cc:47:23: error: 'memset' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation
   47 |                 memset(used, 0, sizeof(used));
      |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
a.cc:44:15: note: 'memset' declared here, later in the translation unit
   44 |         memset(match, -1, sizeof(match));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~