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

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

using namespace std;

int V;
vector<int> G[1010];
int match[1010];
bool used[1010];

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

bool dfs(int v) {
	used[v] = true;
	for (int i = 0; i < G[v].size(); i++) {
		int u = G[v][i];
		int 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;
}

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

int main() {
	int m, n;
	while (cin >> m >> n) {
		if (m == 0 && n == 0) {
			break;
		}
		for (int i = 0; i < 1010; i++) {
			G[i].clear();
		}
		V = m + n;
		vector<long long int> b(m);
		vector<long long int> r(n);
		for (int i = 0; i < m; i++) {
			cin >> b[i];
		}
		for (int i = 0; i < n; i++) {
			cin >> 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, m+j);
				}
			}
		}
		cout << bipartite_matching() << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int bipartite_matching()':
a.cc:33:9: error: 'memset' was not declared in this scope
   33 |         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 <algorithm>
  +++ |+#include <cstring>
    4 |
Language: C++

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

using namespace std;

int V;
vector<int> G[1010];
int match[1010];
bool used[1010];

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

bool dfs(int v) {
	used[v] = true;
	for (int i = 0; i < G[v].size(); i++) {
		int u = G[v][i];
		int 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;
}

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

int main() {
	int m, n;
	while (cin >> m >> n) {
		if (m == 0 && n == 0) {
			break;
		}
		for (int i = 0; i < 1010; i++) {
			G[i].clear();
		}
		V = m + n;
		vector<long long int> b(m);
		vector<long long int> r(n);
		for (int i = 0; i < m; i++) {
			cin >> b[i];
		}
		for (int i = 0; i < n; i++) {
			cin >> 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, m+j);
				}
			}
		}
		cout << bipartite_matching() << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int bipartite_matching()':
a.cc:34:9: error: 'memset' was not declared in this scope
   34 |         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 <algorithm>
  +++ |+#include <cstring>
    4 | #include <string>
Language: C++

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

// MEMO
//
// O(VE)

// THE BEGINNING OF THE LIBRARY.

struct BipartiteMatching {
	using UnWeightedGraph=vector< vector<int> >;

	int n;
	UnWeightedGraph G;
	vector<int> match,used;

	BipartiteMatching() {}
	BipartiteMatching(int sz):n(sz),G(sz),match(sz),used(sz) {}

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

	bool dfs(int v) {
		used[v]=true;
		for(auto u:G[v]) {
			int 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;
		fill(match.begin(),match.end(),-1);
		for(int v=0;v<n;v++) {
			if(match[v]<0) {
				fill(used.begin(),used.end(),0);
				if(dfs(v)) res++;
			}
		}
		return res;
	}
};

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

// THE ENDING OF THE LIBRARY.
// THE FOLLOWING IS AN EXAMPLE OF USE.

int main() {

	int m,n;
	cin>>m>>n;
	vector<int> a(m),b(n);
	for(int i=0;i<m;i++) cin>>a[i];
	for(int i=0;i<n;i++) cin>>b[i];
	BipartiteMatching bimatch(m+n);
	for(int i=0;i<m;i++) {
		for(int j=0;j<n;j++) {
			if(gcd(a[i],b[j])!=1) bimatch.add_edge(i,j+m);
		}
	}
	cout<<bimatch.bipartite_matching()<<endl;

	return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:52:26: error: expected ';' before 'int'
   52 |         if(a<b) swap(a,b)
      |                          ^
      |                          ;
   53 |         int r;
      |         ~~~               
a.cc:55:17: error: 'r' was not declared in this scope
   55 |                 r=b;b=a%b;a=r;
      |                 ^
Language: C++

#include<cstdio>

using namespace std;
int MAX_V = 1000;

class twoMatching {
private:
  vector<int> G[MAX_V];
  int match[MAX_V];
  bool used[MAX_V];
  int V;
public:
  twoMatching(int v) {
    V = v;
  }
  void add_edge(int u, int v) {
    G[u].push_back(v);
    G[v].push_back(u);
  }

  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 prime[1000]; // max 4000
int primeNumber = 0;

int main() {
  int m, n;
  int b[500], r[500];
  for (int i = 2; i < 4000; i++) {
    bool check = true;
    for (int j = 0; j < primeNumber; j++) {
      if (i % prime[j] == 0) {
        check = false;
        break;
      }
    }
    if (check) {
      prime[primeNumber] = i;
      primeNumber++;
    }
  }

  while (1) {
    scanf("%d%d", &m, &n);
    if (m == 0) break;
    for (int i = 0; i < m; i++) scanf("%d", &b[i]);
    for (int i = 0; i < n; i++) scanf("%d", &r[i]);
    twoMatching t(m + n);
    for (int i = 0; i < primeNumber; i++) {
      for (int j = 0; j < m; j++) {
        if (b[j] % prime[i] != 0) continue;
        for (int k = 0; k < n; k++) {
          if (r[k] % prime[i] != 0) continue;
          t.add_edge(j, k + m);
        }
      }
    }
    printf("%d\n", t.bipartite_matching());
  }
}



Compiler output:
a.cc:8:3: error: 'vector' does not name a type
    8 |   vector<int> G[MAX_V];
      |   ^~~~~~
a.cc:9:13: error: size of array 'match' is not an integral constant-expression
    9 |   int match[MAX_V];
      |             ^~~~~
a.cc:10:13: error: size of array 'used' is not an integral constant-expression
   10 |   bool used[MAX_V];
      |             ^~~~~
a.cc:45:2: error: expected ';' after class definition
   45 | }
      |  ^
      |  ;
a.cc: In member function 'void twoMatching::add_edge(int, int)':
a.cc:17:5: error: 'G' was not declared in this scope
   17 |     G[u].push_back(v);
      |     ^
a.cc: In member function 'bool twoMatching::dfs(int)':
a.cc:23:25: error: 'G' was not declared in this scope
   23 |     for (int i = 0; i < G[v].size(); i++) {
      |                         ^
a.cc:25:11: error: 'w' was not declared in this scope
   25 |       if (w < 0 || !used[w] && dfs(w)) {
      |           ^
a.cc: In member function 'int twoMatching::bipartite_matching()':
a.cc:36:5: error: 'memset' was not declared in this scope
   36 |     memset(match, -1, sizeof(match));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<cstdio>
  +++ |+#include <cstring>
    2 |
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
using namespace std;
typedef long long ll;
const ll MOD = 998244353;
const ll INF = (ll)1000000007 * 1000000007;
const double EPS = 1e-9;
typedef pair<int, int> P;
typedef unsigned int ui;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
struct edge { int to, cap, rev; };
vector<edge> G[300000];
bool used[300000];
void init(int V) {
	rep(i, V) {
		G[i].clear();
	}
}
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;
	for (int i = 0; i < (int)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, (int)MOD);
		if (f == 0)return flow;
		flow += f;
	}
}
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	while (y > 0) {
		int r = x % y; x = y; y = r;
	}
	return x;
}
int main() {
	int m; int n;
	while (cin >> m >> n, m) {
		init(300000);
		int a[501], b[501];
		rep1(i, m) {
			cin >> a[i];
			add_edge(0, i, 1);
		}
		rep1(i, n) {
			cin >> b[i];
			add_edge(i + m, 1 + m + n, 1);
		}
		rep1(i, m) {
			rep1(j, n) {
				if (gcd(a[i], b[j]) > 1) {
					add_edge(i, m + j, 1);
				}
			}
		}
		cout << max_flow(0, 1 + m + n) << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int max_flow(int, int)':
a.cc:65:17: error: 'memset' was not declared in this scope
   65 |                 memset(used, 0, sizeof(used));
      |                 ^~~~~~
a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   14 | #include<complex>
  +++ |+#include <cstring>
   15 | using namespace std;
Language: C++

#include<iostream>
#include<vector>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int m,n,b[500],r[500],p[1000],v[1000];
vector<vector<int> >e;
bool match(int s){
	if(s<0)return 1;
	rep(i,e[s].size())if(!v[e[s][i]]){
		v[e[s][i]]=1;
		if(match(p[e[s][i]]))return p[s]=e[s][i],p[e[s][i]]=s,1;
	}
	return 0;
}
int main(){
	while(cin>>m>>n,m){
		rep(i,m)cin>>b[i];rep(i,n)cin>>r[i];
		
		e.clear();e.resize(m+n);
		rep(i,m)rep(j,n)if(__gcd(b[i],r[j])>1)e[i].push_back(m+j),e[m+j].push_back(i);
		
		int ans=0;rep(i,m+n)p[i]=-1;
		rep(i,m){
			rep(j,m+n)v[j]=0;
			if(match(i))ans++;
		}
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:36: error: '__gcd' was not declared in this scope
   20 |                 rep(i,m)rep(j,n)if(__gcd(b[i],r[j])>1)e[i].push_back(m+j),e[m+j].push_back(i);
      |                                    ^~~~~
Language: C++

#include <iostream>
#include "../lib/define.h"
#include "../lib/graph.h"
#define MAXMN 500
#define Int long long
int B[MAXMN];
int R[MAXMN];

Int gcd(Int a, Int b)
{   
  return b != 0 ? gcd(b, a % b) : a;
}

bool augment(const Graph& g, int u,
	     vector<int>& matchTo, vector<bool>& visited) {
  if (u < 0) return true;
  FOR(e, g[u]) if (!visited[e->dst]) {
    visited[e->dst] = true;
    if (augment(g, matchTo[e->dst], matchTo, visited)) {
      matchTo[e->src] = e->dst;
      matchTo[e->dst] = e->src;
      return true;
    }
  }
  return false;
}
int bipartiteMatching(const Graph& g, int L, Edges& matching) {
  const int n = g.size();
  vector<int> matchTo(n, -1);
  int match = 0;
  REP(u, L) {
    vector<bool> visited(n);
    if (augment(g, u, matchTo, visited)) ++match;
  }
  REP(u, L) if (matchTo[u] >= 0) // make explicit matching
    matching.push_back( Edge(u, matchTo[u]) );
  return match;
}


main() {
  int M,N;
  Graph g;
  while(cin>>M>>N,M) {
    g.clear();
    g.resize(M+N+2);
    REP(i,M) cin>>B[i];
    REP(i,N) cin>>R[i];
    REP(i,M) {
      Edges es, es2;
      REP(j,N) {
	if(gcd(B[i],R[j])!=1) { es.pb(Edge(i,M+j)); es2.pb(Edge(M+j,i)); }
      }
      g[i] = es;
      g[M+i] = es2;
    }
    Edges matching;
    cout << bipartiteMatching(g,M,matching) << endl;
  }
}

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

#include <iostream>
#include <vector>

using namespace std;

#define vec vector
#define pb push_back
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin() i!=(c).end();++i)
#define REP(i,n) for(int i=0; i<(int)(n); i++)
//typedef long long Int;

typedef int Weight;
struct Edge {
  int src, dst;
  Weight weight;
  Edge(int src, int dst) : src(src),dst(dst) {}
  Edge(int src, int dst, Weight weight) :
    src(src), dst(dst), weight(weight) {}
};

bool operator < (const Edge &e, const Edge &f) {
  return e.weight != f.weight ? e.weight > f.weight : e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vec<Edge> Edges;
typedef vec<Edges> Graph;

#define MAXMN 500
int B[MAXMN];
int R[MAXMN];

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

bool augment(const Graph& g, int u,
	     vector<int>& matchTo, vector<bool>& visited) {
  if (u < 0) return true;
  FOR(e, g[u]) if (!visited[e->dst]) {
    visited[e->dst] = true;
    if (augment(g, matchTo[e->dst], matchTo, visited)) {
      matchTo[e->src] = e->dst;
      matchTo[e->dst] = e->src;
      return true;
    }
  }
  return false;
}
int bipartiteMatching(const Graph& g, int L) {
  const int n = g.size();
  vector<int> matchTo(n, -1);
  int match = 0;
  REP(u, L) {
    vector<bool> visited(n);
    if (augment(g, u, matchTo, visited)) ++match;
  }
  return match;
}


int main(int argc, char **argv) {
  int M,N;
  Graph g; g.reserve(MAXMN+MAXMN);
  while(cin>>M>>N,M) {
    g.clear();
    g.resize(M+N);
    REP(i,M) cin>>B[i];
    REP(i,N) cin>>R[i];
    REP(i,M) {
      Edges es, es2;
      REP(j,N) {
	if(gcd(B[i],R[j])!=1) { es.pb(Edge(i,M+j)); es2.pb(Edge(M+j,i)); }
      }
      g[i] = es;
      g[M+i] = es2;
    }
    cout << bipartiteMatching(g,M) << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'bool augment(const Graph&, int, std::vector<int>&, std::vector<bool>&)':
a.cc:39:7: error: expected ';' before 'e'
   39 |   FOR(e, g[u]) if (!visited[e->dst]) {
      |       ^
a.cc:8:57: note: in definition of macro 'FOR'
    8 | #define FOR(i,c) for(__typeof((c).begin())i=(c).begin() i!=(c).end();++i)
      |                                                         ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#define INF 1000000000
#define MAX_V 1000
#define MAX 10000000
using namespace std;

int V;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];

bool prime[MAX+1];

void eratos(){
  int n=MAX;
  for(int i=0;i<=n;i++) prime[i]=false;
  for(int i=3;i<=n;i+=2) prime[i]=true;
  prime[2]=true;
  int limit=(int)sqrt((double)n)+1;
  for(int i=3;i<=limit;i+=2){
    if(!prime[i]) continue;
    for(int j=i+i;j<=n;j+=i)
      prime[j]=false;
  }
}

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

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;
}

main(){
  eratos();
  int primdata[664580];
  for(int i=0, j=0;i<=MAX;i++){
    if(prime[i]) primdata[j++]=i;
  }
  primdata[664579]=-1;
  int m, n;
  while(1){
    cin >> m >> n;
    if(m==0 && n==0) break;
    for(int i=0;i<m+n;i++){
      G[i].clear();
    }
    int in1[500], in2[500];
    for(int i=0;i<m;i++){
      cin >> in1[i];
    }
    for(int i=0;i<n;i++){
      cin >> in2[i];
    }
    bool can[500][500];
    for(int i=0;i<m;i++){
      for(int j=0;j<n;j++){
	can[i][j]=false;
	for(int k=0;;k++){
	  if(primdata[k]==-1) break;
	  if(primdata[k]>in1[i] || primdata[k]>in2[j]) break;
	  if(in1[i]%primdata[k]==0 && in2[j]%primdata[k]==0) can[i][j]=true;
	}
      }
    }
    for(int i=0;i<m;i++){
      for(int j=0;j<n;j++){
	if(can[i][j]){
	  add_edge(i, m+j);
	}
      }
    }
    V=m+n;
    cout << bipartite_matching() << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int bipartite_matching()':
a.cc:49:3: error: 'memset' was not declared in this scope
   49 |   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 <cmath>
  +++ |+#include <cstring>
    4 | #define INF 1000000000
a.cc: At global scope:
a.cc:61:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   61 | main(){
      | ^~~~
Language: C++

#include<iostream>
#define INF 10000000
#include<algorithm>
#include<cmath>
#include<vector>
#define MAX_V 1003
#define MAX_N 501
#define MAX_M 501
using namespace std;
struct edge{
	int to,cap,rev;
};
bool used[MAX_V];
bool can[MAX_N][MAX_M];
vector<edge> G[MAX_V];
void add_edge(int from,int to,int cap){
	edge pre;
	pre.to=to;pre.cap=cap;pre.rev=G[to].size();
	G[from].push_back(pre);
	pre.to=from;pre.cap=0;pre.rev=G[from].size()-1;
	G[to].push_back(pre);
}
int N,M;
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;
	}
}
void solve(){
	int s=N+M,t=s+1;
	for(int i=0;i<M;i++){
		add_edge(s,i,1);
	}
	for(int i=0;i<N;i++){
		add_edge(M+i,t,1);
	}
	for(int i=0;i<M;i++){
		for(int j=0;j<N;j++){
			if(can[i][j]){
				add_edge(i,M+j,1);
			}
		}
	}
	cout<<max_flow(s,t)<<endl;
}
int main(){
	int n[501],m[501];
	while(cin>>M>>N,N||M){
		for(int i=0;i<M;i++){
			cin>>m[i];
		}
		
		for(int i=0;i<N;i++){
			cin>>n[i];
		}
		for(int i=0;i<M;i++)
		for(int j=0;j<N;j++){
			can[i][j]=0;
			if(__gcd(m[i],n[j])>1){
				can[i][j]=1;
			}
		}
		solve();
		for(int i=0;i<=M+N+1;i++)
		G[i].clear();
	}
	return 0;
}

Compiler output:
a.cc: In function 'int max_flow(int, int)':
a.cc:43:17: error: 'memset' was not declared in this scope
   43 |                 memset(used,0,sizeof(used));
      |                 ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<vector>
  +++ |+#include <cstring>
    6 | #define MAX_V 1003
Language: C++

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

using namespace std;

const int MAX_V = 10000;
const int INF = 100000000;

// ¸_
int V;
// OtÌXg\»
vector<int> G[MAX_V];
// }b`OÌyA
int match[MAX_V];
// dfsÅ·ÅÉ²×½©Ç¤©ÌtO
static bool used[MAX_V];

// uÆvðÔÓðOtÉÇÁ
void add_edge(int u,int v){
	G[u].push_back(v);
	G[v].push_back(u);
}

// ÁpXðdfsÅT·
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;
}

// ñOtÌÅå}b`Oðßé
int bipartite_matching(){
	int res = 0;
	memset(match,-1,sizeof(match));
	//for(int i = 0; i < sizeof(match); i++){
	//	if(i==sizeof(match)-1){
	//		cout<<endl;
	//	}
	//	match[i] = -1;
	//}
	for(int v = 0; v < V; v++){
		if(match[v] < 0){
			for(int i = 0; i < sizeof(used); i++)
				used[i] = 0;
//			memset(used,0,sizeof(used));
			if(dfs(v)){
				res++;
			}
		}
	}
	return res;
}

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


int main(){

	int n,m;
	while(cin>>m>>n&&!(m==0&&n==0)){
		for(int i = 0; i < MAX_V; i++)
			G[i].clear();

		vector<int> bs,rs;
		int b,r;
		for(int i = 0; i < m; i++){
			cin>>b;
			bs.push_back(b);
			V++;
		}
		for(int i = 0; i < n; i++){
			cin>>r;
			rs.push_back(r);
			V++;
		}
		for(int i = 0; i < rs.size(); i++){
			for(int j = 0;j < bs.size(); j++){
				int res=gcd(rs[i],bs[j]);
				if(res!=1)
					add_edge(i,j+rs.size());
			}
		}
		cout<<bipartite_matching()<<endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int bipartite_matching()':
a.cc:42:9: error: 'memset' was not declared in this scope
   42 |         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 <algorithm>
  +++ |+#include <cstring>
    4 |
Language: C++

// Hopcroft-Karp Algorithm
// O(|E| * |V|^(1/2))
// http://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm
// aoj 1163

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

int NIL;
const int inf = 1<<29;

typedef vector<int> vi;
typedef vector<vector<int> > Graph;

bool bfs(const Graph &g,vi &dist,const vi &pair,int m) {
    queue<int> q;

    for(int i=0; i<m; ++i)
        if(pair[i] == NIL) {
            dist[i] = 0;
            q.push(i);
        }else dist[i] = inf;
    dist[NIL] = inf;

    while(!q.empty()) {
        int v = q.front(); q.pop();
        for(int i=0; i<g[v].size(); ++i) {
            int u = g[v][i];
            if(dist[pair[u]] == inf) {
                dist[pair[u]] = dist[v]+1;
                q.push(pair[u]);
            }
        }
    }
    return dist[NIL] != inf;
}

bool dfs(int v,const Graph &g,vi &dist,vi &pair) {
    for(int i=0; i<g[v].size(); ++i) {
        int u = g[v][i];
        if(dist[pair[u]] == dist[v]+1) {
            if(dfs(pair[u],g,dist,pair)) {
                pair[u] = v, pair[v] = u;
                return true;
            }
        }
    }
    dist[v] = inf;
    return false;
}

// 0ツつゥツづァm-1ツづ慊づづ個静淞点ツづツつゥツづァn-1ツづ慊づづ個静淞点ツづづ個催妥・ツマツッツチツδ督グツづーツ仰づ淞づゥ
int hopcroft_karp(Graph &graph,int m) {
    NIL = graph.size(); graph.push_back(vector<int>(0));
    vi pair(n+1, NIL), dist(n+1, 0);
    int ret = 0;
    while(bfs(graph,dist,pair,m)) {
        for(int i=0; i<m; ++i)
            if(pair[i] == NIL)
                if(v == NIL || dfs(i,graph,dist,pair)) ret++;
    }
    return ret;
}

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

int main() {
    ios::sync_with_stdio(false);
    int m,n;
    while(cin>>m>>n, m|n) {
        Graph g(m+n);
        vector<int> b(m), r(n);
        for(int i=0; i<m; ++i) cin>>b[i];
        for(int i=0; i<n; ++i) cin>>r[i];

        for(int i=0; i<m; ++i)
            for(int j=0; j<n; ++j)
                if(gcd(b[i],r[j]) > 1)
                    g[i].push_back(j+m);
        cout<<hopcroft_karp(g,m)<<endl;
    }
}

Compiler output:
a.cc: In function 'int hopcroft_karp(Graph&, int)':
a.cc:57:13: error: 'n' was not declared in this scope
   57 |     vi pair(n+1, NIL), dist(n+1, 0);
      |             ^
a.cc:62:20: error: 'v' was not declared in this scope
   62 |                 if(v == NIL || dfs(i,graph,dist,pair)) ret++;
      |                    ^
Language: C++

// Hopcroft-Karp Algorithm
// O(|E| * |V|^(1/2))
// http://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm
// aoj 1163

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

int NIL;
const int inf = 1<<29;

typedef vector<int> vi;
typedef vector<vector<int> > Graph;

bool bfs(const Graph &g,vi &dist,const vi &pair,int m) {
    queue<int> q;

    for(int i=0; i<m; ++i)
        if(pair[i] == NIL) {
            dist[i] = 0;
            q.push(i);
        }else
            dist[i] = inf;
    dist[NIL] = inf;

    while(!q.empty()) {
        int v = q.front(); q.pop();
        if(v == NIL) continue;
        for(int i=0; i<g[v].size(); ++i) {
            int u = g[v][i];
            if(dist[pair[u]] == inf) {
                dist[pair[u]] = dist[v]+1;
                q.push(pair[u]);
            }
        }
    }
    return dist[NIL] != inf;
}

bool dfs(int v,const Graph &g,vi &dist,vi &pair) {
    if(v != NIL) {
        for(int i=0; i<g[v].size(); ++i) {
            int u = g[v][i];
            if(dist[pair[u]] == dist[v]+1) {
                if(dfs(pair[u],g,dist,pair)) {
                    pair[u] = v, pair[v] = u;
                    return true;
                }
            }
        }
        dist[v] = inf;
        return false;
    }
    return true;
}

// 0ツつゥツづァm-1ツづ慊づづ個静淞点ツづツつゥツづァn-1ツづ慊づづ個静淞点ツづづ個催妥・ツマツッツチツδ督グツづーツ仰づ淞づゥ
int hopcroft_karp(Graph &graph,int m) {
    const int n = graph.size();
    NIL = n;
    vi pair(n+1, NIL), dist(n+1, 0);
    int ret = 0;
    while(bfs(graph,dist,pair,m)) {
        for(int i=0; i<m; ++i)
            if(pair[i] == NIL)
                if(v == NIL || dfs(i,graph,dist,pair)) ret++;
    }
    return ret;
}

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

int main() {
    ios::sync_with_stdio(false);
    int m,n;
    while(cin>>m>>n, m|n) {
        Graph g(m+n);
        vector<int> b(m), r(n);
        for(int i=0; i<m; ++i) cin>>b[i];
        for(int i=0; i<n; ++i) cin>>r[i];

        for(int i=0; i<m; ++i)
            for(int j=0; j<n; ++j)
                if(gcd(b[i],r[j]) > 1)
                    g[i].push_back(j+m);
        cout<<hopcroft_karp(g,m)<<endl;
    }
}

Compiler output:
a.cc: In function 'int hopcroft_karp(Graph&, int)':
a.cc:68:20: error: 'v' was not declared in this scope
   68 |                 if(v == NIL || dfs(i,graph,dist,pair)) ret++;
      |                    ^
Language: C++

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

const int INF = 1<<28;

struct E {
  int to, cost, cap, rev;
  E(int to, int cost, int cap, int rev)
    : to(to), cost(cost), cap(cap), rev(rev) {}
  E() {}
};

typedef vector<vector<E> > G;

void addEdgeF(int from, int to, int cost, int cap, G &g) {
  g[from].push_back(E(to,cost,cap,g[to].size()));
  g[to].push_back(E(from,cost,0,(int)g[from].size()-1));
}

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

int maxFlow(int s, int t, G g) {
  int flow = 0;
  bool used[g.size()];
  while(1) {
    memset(used, 0, sizeof(used));
    int f = dfsF(s, t, INF, used, g);
    if(f == 0) break;
    flow += f;
  }
  return flow;
}

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

int main() {
  int m, n, tmp;
  vector<int> b, r;
  G g;
  while(cin >> m >> n && (m|n)) {
    b.resize(m);
    r.resize(n);
    for(int i = 0; i < m; ++i) {
      cin >> b[i];
    }
    for(int i = 0; i < n; ++i) {
      cin >> r[i];
    }

    g = G(m+n+2);
    for(int i = 0; i < m; ++i) {
      addEdgeF(m+n, i, 0, 1, g);
    }
    for(int i = 0; i < m; ++i) {
      for(int j = 0; j < n; ++j) {
        if(gcd(b[i], r[j]) != 1) {
          addEdgeF(i, m+j, 0, 1, g);
        }
      }
    }
    for(int i = 0; i < n; ++i) {
      addEdgeF(m+i, m+n+1, 0, 1, g);
    }
    cout << maxFlow(m+n, m+n+1, g) << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int maxFlow(int, int, G)':
a.cc:43:5: error: 'memset' was not declared in this scope
   43 |     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 | using namespace std;
Language: C++

#include <stdio.h>
#include <vector>

using namespace std;

typedef struct{
	int t;
	int c;
	int r;
} edge;

vector<edge> g[502];

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


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

int uv[502];

int dfs(int v,int t,int f){
	int i;
	if(v == t) return f;
	uv[v] = 0;
	for(i = 0;i < g[v].size();i++){
		if(uv[g[v][i].t] && g[v][i].c > 0){
			int d = dfs(g[v][i].t,t,min(f,g[v][i].c));
			if(d > 0){
				g[v][i].c -= d;
				g[g[v][i].t][g[v][i].r].c += d;
				return d;
			}
		}
	}
	return 0;
}


int maxflow(int s,int t){
	int f, res = 0;
	while(1){
		memset(uv,-1,sizeof(uv));
		f = 0;
		f += dfs(s,t,2);
		if(f == 0) return res;
		res += f;
	}
	return res;
}

int main(void){
	int m, n, b[500], r[500], i, j;
	while(1){
		scanf("%d%d",&m,&n);
		if(m + n == 0) break;
		for(i = 0;i < m;i++)
			scanf("%d",&b[i]);
		for(i = 0;i < n;i++)
			scanf("%d",&r[i]);
		for(i = 0;i < m;i++)
			add_edge(0,i + 1,1);
		for(i = 0;i < m;i++){
			for(j = 0;j < n;j++){
				if(gcd(b[i],r[j]) != 1){
					add_edge(i + 1,m + j + 1,1);
				}
			}
		}
		for(i = 0;i < n;i++)
			add_edge(m + i + 1,m + n + 1,1);
		printf("%d\n",maxflow(0,m + n + 1));
		for(i = 0;i < m + n + 2;i++)
			while(g[i].size()) g[i].pop_back();
	}
	return 0;
}

Compiler output:
a.cc: In function 'void add_edge(int, int, int)':
a.cc:15:37: warning: narrowing conversion of 'g[to].std::vector<edge>::size()' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
   15 |         edge e1 = {to,cap,g[to].size()};
      |                           ~~~~~~~~~~^~
a.cc:17:42: warning: narrowing conversion of '(g[from].std::vector<edge>::size() - 1)' from 'std::vector<edge>::size_type' {aka 'long unsigned int'} to 'int' [-Wnarrowing]
   17 |         edge e2 = {from,0,g[from].size() - 1};
      |                           ~~~~~~~~~~~~~~~^~~
a.cc: In function 'int maxflow(int, int)':
a.cc:50:17: error: 'memset' was not declared in this scope
   50 |                 memset(uv,-1,sizeof(uv));
      |                 ^~~~~~
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 |
Language: C++

#define _GLIBCXX_DEBUG
#include <iostream>
#include <vector>

using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

typedef int Weight;
struct Edge {
  int src, dst;
  Weight weight;
  Edge(int src, int dst, Weight weight) :
    src(src), dst(dst), weight(weight) { }
};
bool operator < (const Edge &e, const Edge &f) {
  return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
    e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

typedef vector<Weight> Array;
typedef vector<Array> Matrix;

bool augment(const Graph& g, int u,
			 vector<int>& matchTo, vector<bool>& visited) {
  if(u < 0) return true;
  FOR(e, g[u]) if(!visited[e->dst]) {
	visited[e->dst] = true;
	if(augment(g, matchTo[e->dst], matchTo, visited)) {
	  matchTo[e->src] = e->dst;
	  matchTo[e->dst] = e->src;
	  return true;
	}
  }
  return false;
}

int bipartiteMatching(const Graph& g, int L) {
  const int n = g.size();
  vector<int> matchTo(n, -1);
  int match = 0;
  REP(u, L) {
	vector<bool> visited(n);
	if(augment(g, u, matchTo, visited)) ++ match;
  }

  return match;
}

int main() {
  int blue[500], red[500];
  int m, n;
  
  while(cin >> m >> n && (m|n)) {
	Graph g(m+n);
	REP(i, m) cin >> blue[i];
	REP(i, n) cin >> red[i];
	
	REP(i, m) REP(j, n) {
	  if(__gcd(blue[i], red[j]) > 1) {
		g[i].push_back(Edge(i, m+j, 1));
		g[m+j].push_back(Edge(m+j, i, 1));
	  }
	}
	
	cout << bipartiteMatching(g, m) << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:14: error: '__gcd' was not declared in this scope
   64 |           if(__gcd(blue[i], red[j]) > 1) {
      |              ^~~~~
Language: C++

from fractions import gcd

V = 1003
G = []
visited = []
match = []

def add_edge(u,v):
    G[u].append(v)
    G[v].append(u)

def dfs(v):
    visited[v] = True
    for u in G[v]:
        w = match[u]
        if w < 0 or not visited[w] and dfs(w):
            match[v] = u
            match[u] = v
            return True

def bipartite_matching():
    global match,visited
    res = 0
    match = [-1]*V
    for v in xrange(V):
        if match[v] < 0:
            visited = [False]*V
            if dfs(v):
                res += 1
    return res

while True:
    m,n = map(int,raw_input().split())
    if m|n == 0:
        break
    V = m+n+2
    G = [[] for _ in xrange(V)]
    visited = [True] * V
    data = []
    while len(data) < n+m:
        data += map(int,raw_input().split())
    for i,b in enumerate(data[:m]):
        for j,r in enumerate(data[m:],m):
            if gcd(b,r) != 1:
                add_edge(i,j)
    print bipartite_matching()

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from fractions import gcd
      | ^~~~
Language: C++

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

int V;
vector<int> G[2000];
int match[2000];
bool used[2000];

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

bool dfs(int v){
  used[v]=true;
  for(int i=0;i<(int)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 m,n;
int b[500],r[500];

int main(){
  while(cin>>m>>n){
    if(m==0&&n==0)break;

    for(int i=0;i<m;i++)cin>>b[i];
    for(int i=0;i<n;i++)cin>>r[i];

    for(int i=0;i<2000;i++)G[i].clear();

    //for(int i=0;i<m;i++)add_edge(n+m,i);
    //for(int i=0;i<n;i++)add_edge(m+i,n+m+1);

    for(int i=0;i<m;i++){
      for(int j=0;j<n;j++){
	if( __gcd(b[i],r[j])> 1 )add_edge(i,m+j);
      }
    }

    V=m;
    cout<<bipartite_matching()<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int bipartite_matching()':
a.cc:33:3: error: 'memset' was not declared in this scope
   33 |   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<vector>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: Java

import java.util.*;

public class main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(in.hasNext()){
			int n = in.nextInt();
			if(n == 0) break;
			int xmax=0,xmin=0,ymax=0,ymin=0;
			ArrayList<Integer> x = new ArrayList<Integer>();
			ArrayList<Integer> y = new ArrayList<Integer>();
			x.add(0);
			y.add(0);
			for(int i=1; i<n; i++){
				int id = in.nextInt();
				switch(in.nextInt()){
				case 0:
					x.add(x.get(id)-1);
					y.add(y.get(id));
					break;
				case 1:
					x.add(x.get(id));
					y.add(y.get(id)-1);
					break;
				case 2:
					x.add(x.get(id)+1);
					y.add(y.get(id));
					break;
				case 3:
					x.add(x.get(id));
					y.add(y.get(id)+1);
					break;
				}
				xmax = Math.max(xmax, x.get(i));
				xmin = Math.min(xmin, x.get(i));
				ymax = Math.max(ymax, y.get(i));
				ymin = Math.min(ymin, y.get(i));
				
			}
			System.out.println((xmax-xmin+1)+" "+(ymax-ymin+1));
		}
		
	}

}

Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: Java

import java.awt.Point;
import java.io.InputStream;
import java.util.LinkedList;
import java.util.Scanner;

public class A {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		InputStream in = System.in;
		Scanner scanner = new Scanner(in);
		LinkedList<String> ans = new LinkedList<String>();
		while(true) {
			int num = scanner.nextInt();
			if(num == 0)
				break;
			LinkedList<Point> data = new LinkedList<Point>();
			// 0番目の四角形
			Point zero = new Point(0, 0);
			data.add(zero);
			for(int i=0; i < num - 1; i++) {
				Point cur = data.get(scanner.nextInt());
				int dir = scanner.nextInt();
				Point tmp = new Point(cur);
				switch (dir) {
				case 0:
					tmp.translate(-1, 0);
					break;
				case 1:
					tmp.translate(0, -1);
					break;
				case 2:
					tmp.translate(1, 0);
					break;
				case 3:
					tmp.translate(0, 1);
					break;
				default:
					break;
				}
				data.add(tmp);
			}
			int minX, minY, maxX, maxY;
			minX = minY = maxX = maxY = 0;
			for(Point val : data) {
				if(val.x < minX)
					minX = val.x;
				if(val.y < minY)
					minY = val.y;
				if(maxX < val.x)
					maxX = val.x;
				if(maxY < val.y)
					maxY = val.y;
			}
			int width = maxX - minX + 1;
			int height = maxY - minY + 1;
			ans.add(width + " " + height);
		}
		for(String val : ans) {
			System.out.println(val);
		}
	}

}

Compiler output:
Main.java:6: error: class A is public, should be declared in a file named A.java
public class A {
       ^
1 error
Language: Java

class Main {
public static void main(String args[]) {
new Main().run();
}

Scanner in = new Scanner(System.in);
int[] vx = {-1, 0, 1, 0};
int[] vy = {0, 1, 0, -1};

public void run() {
while (true) {
int n = in.nextInt();
if (n == 0) break;
int[] x = new int[n];
int[] y = new int[n];

x[0] = y[0] = 0;

int minX = 0, minY = 0, maxX = 0, maxY = 0;

for (int i = 0; i < n - 1; i++) {
int c = in.nextInt(), d = in.nextInt();
x[i+1] = x[c] + vx[d];
minX = Math.min(minX, x[i+1]);
maxX = Math.max(maxX, x[i+1]);
y[i+1] = y[c] + vy[d];
minY = Math.min(minY, x[i+1]);
maxY = Math.max(maxY, x[i+1]);
}

System.out.println((maxX - minX + 1) * (maxY - minY + 1));
}
}

Compiler output:
Main.java:33: error: reached end of file while parsing
}
 ^
1 error
Language: Java

class Main {
public static void main(String args[]) {
new Main().run();
}

Scanner in = new Scanner(System.in);
int[] vx = {-1, 0, 1, 0};
int[] vy = {0, 1, 0, -1};

public void run() {
while (true) {
int n = in.nextInt();
if (n == 0) break;
int[] x = new int[n];
int[] y = new int[n];

x[0] = y[0] = 0;

int minX = 0, minY = 0, maxX = 0, maxY = 0;

for (int i = 0; i < n - 1; i++) {
int c = in.nextInt(), d = in.nextInt();
x[i+1] = x[c] + vx[d];
minX = Math.min(minX, x[i+1]);
maxX = Math.max(maxX, x[i+1]);
y[i+1] = y[c] + vy[d];
minY = Math.min(minY, x[i+1]);
maxY = Math.max(maxY, x[i+1]);
}

System.out.println((maxX - minX + 1) * (maxY - minY + 1));
}
}
}

Compiler output:
Main.java:6: error: cannot find symbol
Scanner in = new Scanner(System.in);
^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
Scanner in = new Scanner(System.in);
                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C

#include<stdio.h>
 
int main()
{
  int i,j,k,N,wmax,hmax,count,flag;
  int d[200]={0},n[200]={0};
  int board[401][401];
  
  while(scanf("%d",&N),N){
    count=0;
    for(i=0;i<401;i++){
      for(j=0;j<401;j++){
        board[i][j]=-1;
      }
    }
    board[200][200]=0;
    
    for(i=1;i<N;i++){
      scanf("%d%d",&n[i],&d[i]);
    }
    
    for(k=1;k<N;k++){
      for(i=0;i<401;i++){
        for(j=0;j<401;j++){
          if(board[i][j]==n[k]){
            switch(d[k]){
              case 0:
                board[i][j-1]=k;
                break;
              case 1:
                board[i+1][j]=k;
                break;
              case 2:
                board[i][j+1]=k;
                break;
              case 3:
                board[i-1][j]=k;
                break;
            }
          }
        }
      }
    }
    
    wmax=0;
    wmin=401;
    for(i=0;i<401;i++){
      flag=0;
      for(j=0;j<401;j++){
        if(board[i][j]>-1){
          for(k=400;k>=0;k--){
            if(board[i][k]>-1){
              count=k-j+1;
              flag=1;
              break;
            }
          }
        }
        if(flag) break;
        if(wmax<count) wmax=count;
      }
    }
    
    hmax=0;
    count=0;
    for(i=0;i<401;i++){
      flag=0;
      for(j=0;j<401;j++){
        if(board[j][i]>-1){
          for(k=400;k>=0;k--){
            if(board[k][i]>-1){
              count=k-j+1;
              flag=1;
              break;
            }
          }
        }
        if(flag) break;
        if(hmax<count) hmax=count;
      }
    }
    printf("%d %d\n",wmax,hmax);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:46:5: error: 'wmin' undeclared (first use in this function)
   46 |     wmin=401;
      |     ^~~~
main.c:46:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void){
  int i, j, a, b, n, tate, yoko, s[400][400], t[200], y[200];
  scanf("%d", &n);
  while(n!=0){
    for(i=0;i<400;i++){
      for(j=0;j<400;j++){
        s[i][j]=0;
      }
      if(i<200){
      t[i]=0;
      y[i]=0;
      }
    }
    t[0]=200;
    y[0]=200;
    s[200][200]=1;
    for(i=1;i<n;i++){
      scanf("%d %d", &a, &b);
      if(b==0){
        s[t[a]][y[a]-1]=1;
        t[i]=t[a];
        y[i]=y[a]-1;
      }else if(b==1){
        s[t[a]+1][y[a]]=1;
        t[i]=t[a]+1;
        y[i]=y[a];
      }else if(b==2){
        s[t[a]][y[a]+1]=1;
        t[i]=t[a];
        y[i]=y[a]+1;
      }else{
        s[t[a]-1][y[a]]=1;
        t[i]=t[a]-1;
        y[i]=y[a];
      }
    }

    yoko=0;
    for(i=0;i<400;i++){
      for(j=0;j<400;j++){
        if(s[i][j]==1){
          yoko++;
          break;
        }
      }
    }
    tate=0;
    for(i=0;i<400;i++){
      for(j=0;j<400;j++){
        if(s[j][i]==1){
          tate++;
          break;
        }
      }
    }
    printf("%d %d\n", tate, yoko);
    }
    scanf("%d", &n);
  }

  return 0;
}

Compiler output:
main.c:62:3: error: expected identifier or '(' before 'return'
   62 |   return 0;
      |   ^~~~~~
main.c:63:1: error: expected identifier or '(' before '}' token
   63 | }
      | ^
Language: C

#include <stdio.h>
int x[400][400]={};
int　a=200,b=200,n,i,j,k,c,d,w=0,h=0;
x[a][b]=1;
int main(){
while(1){
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d%d",&c,&d);
for(j=-n;j<n;j++){
for(k=-n;k<n;k++){
if(x[a+j][b+k]==c+1){
if(d==0) x[a-1+j][b+k]=i+1;
if(d==1) x[a+j][b-1+k]=i+1;
if(d==2) x[a+1+j][b+k]=i+1;
if(d==3) x[a+j][b+1+k]=i+1;
}}}}
for(i=0;i<400;i++){
for(j=0;j<400;j++){
if(x[i][j]!=0){
w++;
goto aaa;
}
if(x[j][i]!=0){
h++;
goto aaa;
}
}aaa:}
printf("%d %d\n",w,h);
}
return 0;
}

Compiler output:
main.c:3:4: error: stray '\343' in program
    3 | int<U+3000>a=200,b=200,n,i,j,k,c,d,w=0,h=0;
      |    ^~~~~~~~
main.c:4:1: warning: data definition has no type or storage class
    4 | x[a][b]=1;
      | ^
main.c:4:1: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
main.c:4:1: error: variably modified 'x' at file scope
main.c:4:1: error: variably modified 'x' at file scope
main.c:4:1: error: conflicting types for 'x'; have 'int[1][1]'
main.c:2:5: note: previous definition of 'x' with type 'int[400][400]'
    2 | int x[400][400]={};
      |     ^
main.c:4:9: error: invalid initializer
    4 | x[a][b]=1;
      |         ^
Language: C

#include <stdio.h>
  int main(){
	  while(1){
		  int x[400][400]={};
          int a=200,b=200,n,i,j,k,c,d,w=0,h=0;
		  x[a][b]=1;
		  scanf("%d",&n); if(n==0) break;0 
		  for(i=1;i<n;i++){
			  scanf("%d%d",&c,&d);
			  for(j=-n;j<n;j++){
				  for(k=-n;k<n;k++){ 
					  if(x[a+j][b+k]==c+1){
						  if(d==0) x[a-1+j][b+k]=i+1; 
						  if(d==1) x[a+j][b-1+k]=i+1; 
						  if(d==2) x[a+1+j][b+k]=i+1; 
						  if(d==3) x[a+j][b+1+k]=i+1;
					  }
				  }
			  }
		  }
		  for(i=0;i<400;i++){
			  for(j=0;j<400;j++){
				  if(x[i][j]!=0){ 
					  w++;
					  goto aaa; 
				  } } aaa:;}
		  for(i=0;i<400;i++){
			  for(j=0;j<400;j++){
				  if(x[j][i]!=0){ 
					  h++;
					  goto baa; 
				  } } baa:;}
		  printf("%d %d\n",w,h);
	  }
	  return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:7:51: error: expected ';' before 'for'
    7 |                   scanf("%d",&n); if(n==0) break;0
      |                                                   ^
      |                                                   ;
    8 |                   for(i=1;i<n;i++){
      |                   ~~~
Language: C

#include <stdio.h>
#pragma warning(disable : 4996)

typedef struct{
	int x;
	int y;
}DATA;

int main(){
	int n, x, d;
	int i;
	int hmin,hmax,wmin,wmax;
	DATA data[200];

	data[0].x=0;
	data[0].y=0;
	hmin=0;
	hmax=0;
	wmin=0;
	wmax=0;

	scanf("%d", &n);
	while(true){
		if(n!=0){
			for(i=1; i<n; i++){
				scanf("%d%d",&x ,&d);
				if(d == 0){
					data[i].x=data[x].x-1;
					data[i].y=data[x].y;
				}else if(d == 1){
					data[i].y=data[x].y-1;
					data[i].x=data[x].x;
				}else if(d == 2){
					data[i].x=data[x].x+1;
					data[i].y=data[x].y;
				}else if(d == 3){
					data[i].y=data[x].y+1;
					data[i].x=data[x].x;
				}
				if(data[i].x < wmin)wmin=data[i].x;
				if(data[i].x > wmax)wmax=data[i].x;
				if(data[i].y < hmin)hmin=data[i].y;
				if(data[i].y > hmax)hmax=data[i].y;
			}
		}else{
			break;
		}
		printf("%d %d\n",wmax-wmin+1 ,hmax-hmin+1);
		scanf("%d", &n);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:15: error: 'true' undeclared (first use in this function)
   23 |         while(true){
      |               ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | #pragma warning(disable : 4996)
main.c:23:15: note: each undeclared identifier is reported only once for each function it appears in
   23 |         while(true){
      |               ^~~~
Language: C

#include <stdio.h>

int main(){
	int i,j;
	int a,b,c,d;
	int date_a[200];
	int date_b[200];
	
	while(1){
	date_a[0]=0;
	date_b[0]=0;
	for(i=1;i<200;i++){
		date_a[i]=-1;
		date_b[i]=-1;
	}
	scanf("%d",&c);
	if(c==0){
		break;
	}
	d=1;
	while(c!=d){
			scanf("%d %d",&a,&b);
		if(b%2){
			date_b[d]=date_b[a];
			b==1?date_a[d]=date_a[d-1]+1:date_a[d]=date_a[d-1]-1;
		}else{
			date_a[d]=date_a[a];
			b==0?date_b[d]=date_b[d-1]+1:date_b[d]=date_b[d-1]-1;
		}
		d++;
	}
	int a_max=-1,b_max=-1;
	int a_min=1,b_min=1;
	for(i=0;i<c;i++){
		if(date_a[i]>a_max){
			a_max=date_a[i];
		}
		if(date_a[i]<a_min){
			a_min=date_a[i];
		}
		if(date_b[i]>b_max){
			b_max=date_b[i];
		}
		if(date_b[i]<b_min){
			b_min=date_b[i];
		}
	}
	printf("%d %d\n",b_max-b_min+1,a_max-a_min+1);
}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:63: error: lvalue required as left operand of assignment
   25 |                         b==1?date_a[d]=date_a[d-1]+1:date_a[d]=date_a[d-1]-1;
      |                                                               ^
main.c:28:63: error: lvalue required as left operand of assignment
   28 |                         b==0?date_b[d]=date_b[d-1]+1:date_b[d]=date_b[d-1]-1;
      |                                                               ^