criyle/codenet-compile-errors huggingface dataset:
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:71: 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:71: 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;
      |                                                                       ^
Language: C++

#include<iostream>

using namespace std;




int main()
{
	int n;
	

	while(cin >> n && n)
	{
		int cellnum[500][500];
		int x[300],y[300];
		memset(cellnum,-1,500*500*sizeof(int));
		memset(x,-1,300*sizeof(int));
		memset(y,-1,300*sizeof(int));

		cellnum[250][250] = 0;
		x[0] = 250;
		y[0] = 250;


		for(int i = 1;i < n;i++)
		{
			int tmp0,tmp1;
			cin >> tmp0 >> tmp1;
			
			int tx = 0,ty = 0;

			if(tmp1 == 0)
			{
				tx = -1;
				ty =  0;
			}else
			if(tmp1 == 1)
			{
				tx =  0;
				ty =  1;
			}else
			if(tmp1 == 2)
			{
				tx =  1;
				ty =  0;
			}else
			if(tmp1 == 3)
			{
				tx =  0;
				ty = -1;

			}

			cellnum[x[tmp0] + tx ][y[tmp0] + ty] = i;
			x[i] = x[tmp0] + tx;
			y[i] = y[tmp0] + ty;
		}

		int w = 0,h = 0;

		for(int i = 0;i < 500;i++)
		{
			int sum = 0;
			for(int j = 0;j < 500;j++)
			{
				if(cellnum[i][j] != -1)sum++;
				else
				{
					w = max(w,sum);
					sum = 0;
				}
			}
		}

		for(int i = 0;i < 500;i++)
		{
			int sum = 0;
			for(int j = 0;j < 500;j++)
			{
				if(cellnum[j][i] != -1)sum++;
				else
				{
					h = max(h,sum);
					sum = 0;
				}
			}
		}

		cout << h << " " << w << endl; 



	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'memset' was not declared in this scope
   17 |                 memset(cellnum,-1,500*500*sizeof(int));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define rer(i, a, b) for (int i = (int)a; i <= (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const int inf = 1000000000;
const int mod = 1000000007;
const double eps = 1e-9;
const int dx[] = { -1, 0, 1, 0};
const int dy[] = { 0, -1, 0, 1};

int main() {
	// cin.tie(0); // tie
	// ios::sync_with_stdio(false); // sync
	int N;
	while (cin >> N, N) {
		vector<int> x(N), y(N);
		REP(i, N) {
			int n, d;
			cin >> n >> d;
			x[i] = x[n] + dx[d];
			y[i] = y[n] + dy[d];
		}

		int min_x = INT_MAX, max_x = INT_MIN;
		int min_y = INT_MAX, max_y = INT_MIN;
		rep(i, N) {
			min_x = min(min_x, x[i]);
			max_x = max(max_x, x[i]);
			min_y = min(min_y, y[i]);
			max_y = max(max_y, y[i]);
		}
		cout << (max_x - min_x + 1) << ' ' << (max_y - min_y + 1) << endl;
	}
	return 0;
}

Compiler output:
a.cc:33:25: error: macro "REP" requires 3 arguments, but only 2 given
   33 |                 REP(i, N) {
      |                         ^
a.cc:4:9: note: macro "REP" defined here
    4 | #define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
      |         ^~~
a.cc: In function 'int main()':
a.cc:33:17: error: 'REP' was not declared in this scope
   33 |                 REP(i, N) {
      |                 ^~~
Language: C++

1
5
0 0
0 1
0 2
0 3
12
0 0
1 0
2 0
3 1
4 1
5 1
6 2
7 2
8 2
9 3
10 3
10
0 2
1 2
2 2
3 2
2 1
5 1
6 1
7 1
8 1
0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1
      | ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
	int n;
	int d,e
	int x[200],y[200];
	while(true){
	cin>>n;
	ig(n==0)
	break;
	cin>>d>>e;
	x[0]=0,y[0];
	int dx=0,ux=0,yx=0,uy=0;
	for(int i=1;i<=n;i++){
	cin>>d>>e;
	x[i]=x[d];
	y[i]=y[d];
	if(e==0)
	x[i]--;
	if(e==1)
	x[i]++;
	if(e==2)
	y[i]--;
	if(e==3)
	y[i]++;
	if(x[i]<dx)
	dx=x[i];
	if(x[i]>ux)
	ux=x[i];
	if(y[i]<dy)
	dy=y[i];
	if(y[i]>uy)
	uy=y[i];
	}
	cout<<ux-dx<<" "<<uy-dy<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected initializer before 'int'
    7 |         int x[200],y[200];
      |         ^~~
a.cc:10:9: error: 'ig' was not declared in this scope
   10 |         ig(n==0)
      |         ^~
a.cc:12:17: error: 'e' was not declared in this scope
   12 |         cin>>d>>e;
      |                 ^
a.cc:13:9: error: 'x' was not declared in this scope
   13 |         x[0]=0,y[0];
      |         ^
a.cc:13:16: error: 'y' was not declared in this scope
   13 |         x[0]=0,y[0];
      |                ^
a.cc:31:17: error: 'dy' was not declared in this scope; did you mean 'uy'?
   31 |         if(y[i]<dy)
      |                 ^~
      |                 uy
a.cc:36:30: error: 'dy' was not declared in this scope; did you mean 'uy'?
   36 |         cout<<ux-dx<<" "<<uy-dy<<endl;
      |                              ^~
      |                              uy
Language: C++

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

int dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};

int main(int argc, char *argv[])
{
    int n, ni, di, w, h;
    while (cin >> n, n) {
        vector<int> x(n, 0);
        vector<int> y(n, 0);
        for (int i = 1; i < n; ++i) {
            cin >> ni >> di;
            x[i] = x[ni] + dx[di];
            y[i] = y[ni] + dy[di];
        }
        w = *max_element(x.begin(), x.end()) - *min_element(x.begin(), x.end());
        h = *max_element(y.begin(), y.end()) - *min_element(y.begin(), y.end());
        cout << ++w << ' ' << ++h << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:18:14: error: 'max_element' was not declared in this scope
   18 |         w = *max_element(x.begin(), x.end()) - *min_element(x.begin(), x.end());
      |              ^~~~~~~~~~~
a.cc:18:49: error: 'min_element' was not declared in this scope
   18 |         w = *max_element(x.begin(), x.end()) - *min_element(x.begin(), x.end());
      |                                                 ^~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,n,art[1000][2]={10,10};;
  while(cin>>n,n!=0){
    art[0][2]={10,10};
    for(int i=1;i<n;i++){
      cin>>a>>b;
      if(b==0){art[i][0]=art[a][0];art[i][1]=art[a][1]-1;}
      else if(b==1){art[i][0]=art[a][0]-1;art[i][1]=art[a][1];}
      else if(b==2){art[i][0]=art[a][0];art[i][1]=art[a][1]+1;}
      else if(b==3){art[i][0]=art[a][0]+1;art[i][1]=art[a][1];}
    }
    int ymin=22,ymax=0,xmin=22,xmax=0;
    for(int i=0;i<n;i++){
      if(art[i][0]>ymax)ymax=art[i][0];
      if(art[i][0]<ymin)ymin=art[i][0];
      if(art[i][1]>xmax)xmax=art[i][1];
      if(art[i][1]<xmin)xmin=art[i][1]; 
    }
    cout<<xmax-xmin+1<<" "<<ymax-ymin+1<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: cannot convert '<brace-enclosed initializer list>' to 'int' in assignment
    6 |     art[0][2]={10,10};
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,n,art[1000][2]={10,10};
  while(cin>>n,n!=0){
    art[0][2]={10,10};
    for(int i=1;i<n;i++){
      cin>>a>>b;
      if(b==0){art[i][0]=art[a][0];art[i][1]=art[a][1]-1;}
      else if(b==1){art[i][0]=art[a][0]-1;art[i][1]=art[a][1];}
      else if(b==2){art[i][0]=art[a][0];art[i][1]=art[a][1]+1;}
      else if(b==3){art[i][0]=art[a][0]+1;art[i][1]=art[a][1];}
    }
    int ymin=22,ymax=0,xmin=22,xmax=0;
    for(int i=0;i<n;i++){
      if(art[i][0]>ymax)ymax=art[i][0];
      if(art[i][0]<ymin)ymin=art[i][0];
      if(art[i][1]>xmax)xmax=art[i][1];
      if(art[i][1]<xmin)xmin=art[i][1]; 
    }
    cout<<xmax-xmin+1<<" "<<ymax-ymin+1<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: cannot convert '<brace-enclosed initializer list>' to 'int' in assignment
    6 |     art[0][2]={10,10};
      |                     ^
Language: C++

#include<iostream>
#include<vector>
#include<cmath>
#define INF (1<<29)

using namespace std;

typedef pair<int,int>pii;
typedef pair<pii,int>P;

int main(void){

  int N;
  while(cin >> N,N){
    vector<P>v(N-1);
    
    for(int i=0;i<N-1;i++){
      cin >> v[i].first.first >> v[i].first.second;
      v[i].second = i+1;
    }

    sort(v.begin(),v.end());

    vector<pii>a(N,pii(0,0));

    for(int i=0;i<N-1;i++){
      int costx = 0, costy = 0;
      if(v[i].first.second % 2 == 0)costx = v[i].first.second - 1;
      else costy = v[i].first.second - 2;

      a[v[i].second].first = a[v[i].first.first].first + costx;
      a[v[i].second].second = a[v[i].first.first].second + costy;
    }

    int minx=INF,maxx=-INF,miny=INF,maxy=-INF;
    for(int i=0;i<N;i++){
      minx = min(minx, a[i].first);
      maxx = max(maxx, a[i].first);
      miny = min(miny, a[i].second);
      maxy = max(maxy, a[i].second);
    }
    
    cout << maxx+abs(minx)+1 << " " << maxy+abs(miny)+1 << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   22 |     sort(v.begin(),v.end());
      |     ^~~~
      |     sqrt
Language: C++

#include"bits/stdc++.h"

#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}


using namespace std;

void solve();

int main(){

	solve();
	return 0;

}

void solve(){
	while (1) {
		vector<int> x;
		vector<int> y;
		x.clear();	y.clear();
		x.push_back(0);
		y.push_back(0);

		int n;
		cin >> n;
		if (n == 0)return;

		REP(i, n-1) {

			int ni, di;
			cin >> ni >> di;

			switch (di)
			{
			case 0:
				x.push_back(x[ni] - 1);
				y.push_back(y[ni]);
				break;
			case 1:
				x.push_back(x[ni]);
				y.push_back(y[ni] - 1);
				break;
			case 2:
				x.push_back(x[ni] + 1);
				y.push_back(y[ni]);
				break;
			case 3:
				x.push_back(x[ni]);
				y.push_back(y[ni] + 1);
				break;
			default:
				break;
			}

		}

		sort(x.begin(), x.end());	sort(y.begin(), y.end());

		cout << x[x.size()-1]-x[0] + 1 << ' ' << y[y.size()-1]-y[0]+ 1 << endl;
	}
}

Compiler output:
a.cc:10:22: error: 'ostream' does not name a type
   10 | template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
      |                      ^~~~~~~
a.cc:13:22: error: 'ostream' does not name a type
   13 | template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
      |                      ^~~~~~~
a.cc: In function 'void solve()':
a.cc:3:25: error: 'll' was not declared in this scope
    3 | #define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
      |                         ^~
a.cc:5:18: note: in expansion of macro 'FOR'
    5 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:41:17: note: in expansion of macro 'REP'
   41 |                 REP(i, n-1) {
      |                 ^~~
a.cc:41:21: error: 'i' was not declared in this scope
   41 |                 REP(i, n-1) {
      |                     ^
a.cc:3:49: note: in definition of macro 'FOR'
    3 | #define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
      |                                                 ^
a.cc:41:17: note: in expansion of macro 'REP'
   41 |                 REP(i, n-1) {
      |                 ^~~
a.cc:3:51: error: '__last_i' was not declared in this scope
    3 | #define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
      |                                                   ^~~~~~~
a.cc:5:18: note: in expansion of macro 'FOR'
    5 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:41:17: note: in expansion of macro 'REP'
   41 |                 REP(i, n-1) {
      |                 ^~~
Language: C++

#include"bits/stdc++.h"

#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)


using namespace std;

void solve();

int main(){

	solve();
	return 0;

}

void solve(){
	while (1) {
		vector<int> x;
		vector<int> y;
		x.clear();	y.clear();
		x.push_back(0);
		y.push_back(0);

		int n;
		cin >> n;
		if (n == 0)return;

		REP(i, n-1) {

			int ni, di;
			cin >> ni >> di;

			switch (di)
			{
			case 0:
				x.push_back(x[ni] - 1);
				y.push_back(y[ni]);
				break;
			case 1:
				x.push_back(x[ni]);
				y.push_back(y[ni] - 1);
				break;
			case 2:
				x.push_back(x[ni] + 1);
				y.push_back(y[ni]);
				break;
			case 3:
				x.push_back(x[ni]);
				y.push_back(y[ni] + 1);
				break;
			default:
				break;
			}

		}

		sort(x.begin(), x.end());	sort(y.begin(), y.end());

		cout << x[x.size()-1]-x[0] + 1 << ' ' << y[y.size()-1]-y[0]+ 1 << endl;
	}
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:3:25: error: 'll' was not declared in this scope
    3 | #define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
      |                         ^~
a.cc:5:18: note: in expansion of macro 'FOR'
    5 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:35:17: note: in expansion of macro 'REP'
   35 |                 REP(i, n-1) {
      |                 ^~~
a.cc:35:21: error: 'i' was not declared in this scope
   35 |                 REP(i, n-1) {
      |                     ^
a.cc:3:49: note: in definition of macro 'FOR'
    3 | #define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
      |                                                 ^
a.cc:35:17: note: in expansion of macro 'REP'
   35 |                 REP(i, n-1) {
      |                 ^~~
a.cc:3:51: error: '__last_i' was not declared in this scope
    3 | #define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
      |                                                   ^~~~~~~
a.cc:5:18: note: in expansion of macro 'FOR'
    5 | #define REP(i,n) FOR(i,0,n)
      |                  ^~~
a.cc:35:17: note: in expansion of macro 'REP'
   35 |                 REP(i, n-1) {
      |                 ^~~
Language: C++

#include<bits/stdc++.h>
#define loop(i,n) for(int i=0; i<n; i++)
using namespace std;
int main(){
  int a[250]={},b[250]={}; //aは上下、bは左右
  int n;
  while(1){
    cin >> n;
    if(n==0) break;
    for(int i=1; i<n; i++){
      int x,y;
      cin >> x >> y;
      if(y==0){  //左
        a[i]=a[x];
        b[i]=b[x]-1;
      }
      if(y==1){　//下
        a[i]=a[x]-1;
        b[i]=b[x];
      }
      if(y==2){ //右
        a[i]=a[x];
        b[i]=b[x]+1;
      }
      if(y==3){ //上
        a[i]=a[x]+1;
        b[i]=b[x];
      }
    }
    int amax=0,amin=0,bmax=0,bmin=0;
    loop(i,n){
      amax = max(amax,a[i]);
      amin = min(amin,a[i]);
      bmax = max(bmax,b[i]);
      bmin = min(bmin,b[i]);
    }
    amax-=amin;
    amax++;
    bmax-=bmin;
    bmax++;
    cout << bmax << " " << amax << endl;
    }  
  return 0;
}


Compiler output:
a.cc:17:16: error: extended character 　 is not valid in an identifier
   17 |       if(y==1){　//下
      |                ^
a.cc: In function 'int main()':
a.cc:17:16: error: '\U00003000' was not declared in this scope
   17 |       if(y==1){　//下
      |                ^~
Language: C++

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

int a[512][512];

int main() {
  for(int N; scanf("%d", &N), N; ) {
    memset( a, -1, sizeof(a) );
    
    a[256][256] = 0;

    const int dr[] = {0, 1, 0, -1};
    const int dc[] = {-1, 0, 1, 0};

    for(int i = 1; i < N; i++) {
      int v, dir; scanf("%d%d", &v, &dir);
      
      for(int r = 0; r < 512; r++)
        for(int c = 0; c < 512; c++) {
          if( a[r][c] == v ) {            
            a[r + dr[dir]][c + dc[dir]] = i;            
            goto BK;
          }
        }
    BK:;
    }
    
    
    int left = 512;
    int right = -1;
    int upper = 512;    
    int bottom = -1;

    for(int r = 0; r < 512; r++) {
      for(int c = 0; c < 512; c++) {
        if( a[r][c] != -1 ) {
          left = min(left, c);
          right = max(right, c);

          upper = min(upper, r);
          bottom = max(bottom, r);
        }
      }
    }
    
    cout << (right - left + 1) << " " << (bottom - upper + 1) << endl;
    
  }
  return 0;
}

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


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

//ツ債計ツ行ツ青板づーツ偲ヲツ督セ
int GetRowCount()
{
	int count;
	std::cin >> count;
	return count;
}


typedef enum{LEFT,DOWN,RIGHT,UP} DIRECTION;

typedef struct _BLOCK
{
	int fundmention;
	DIRECTION direct;
	int x,y;

	static bool xPred(struct _BLOCK left,struct _BLOCK right)
	{
		return left.x < right.x;
	}

		static bool yPred(struct _BLOCK left,struct _BLOCK right)
	{
		return left.y < right.y;
	}

} BLOCK;

void GetBoxRect(int rowcount){

	std::vector<BLOCK> blocks;
	BLOCK block;
	memset(&block,0,sizeof(BLOCK));
	blocks.push_back(block);

	for(int i = 0; i < rowcount - 1; i++){
		BLOCK block;
		std::cin >> block.fundmention >> (int &)block.direct;
		blocks.push_back(block);
	}

	for(int i = 1; i < rowcount; i++){
		blocks[i].x = blocks[blocks[i].fundmention].x;
		blocks[i].y = blocks[blocks[i].fundmention].y;
		switch(blocks[i].direct){
			case LEFT:
				blocks[i].x++;
				break;
			case DOWN:
				blocks[i].y++;
				break;
			case RIGHT:
				blocks[i].x--;
				break;
			case UP:
				blocks[i].y--;
				break;
		}
	}

	int w = std::max_element(blocks.begin(),blocks.end(),BLOCK::xPred)->x - std::min_element(blocks.begin(),blocks.end(),BLOCK::xPred)->x + 1;
	int h = std::max_element(blocks.begin(),blocks.end(),BLOCK::yPred)->y - std::min_element(blocks.begin(),blocks.end(),BLOCK::yPred)->y + 1;

	std::cout << w << ' ' << h << std::endl;
}

void A()
{
	int rowcount = GetRowCount();
	while(rowcount != 0){
		GetBoxRect(rowcount);
		rowcount = GetRowCount();
	}
}

int main()
{
	A();

	return 0;
}

Compiler output:
a.cc: In function 'void GetBoxRect(int)':
a.cc:39:9: error: 'memset' was not declared in this scope
   39 |         memset(&block,0,sizeof(BLOCK));
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <algorithm>
  +++ |+#include <cstring>
    5 |
Language: C++

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <algorithm>

//ツ債計ツ行ツ青板づーツ偲ヲツ督セ
int GetRowCount()
{
	int count;
	std::cin >> count;
	return count;
}


typedef enum{LEFT,DOWN,RIGHT,UP} DIRECTION;

typedef struct _BLOCK
{
	int fundmention;
	DIRECTION direct;
	int x,y;

	static bool xPred(struct _BLOCK left,struct _BLOCK right)
	{
		return left.x < right.x;
	}

		static bool yPred(struct _BLOCK left,struct _BLOCK right)
	{
		return left.y < right.y;
	}

} BLOCK;

void GetBoxRect(int rowcount){

	std::vector<BLOCK> blocks;
	BLOCK block;
	memset(&block,0,sizeof(BLOCK));
	blocks.push_back(block);

	for(int i = 0; i < rowcount - 1; i++){
		BLOCK block;
		std::cin >> block.fundmention >> (int &)block.direct;
		blocks.push_back(block);
	}

	for(int i = 1; i < rowcount; i++){
		blocks[i].x = blocks[blocks[i].fundmention].x;
		blocks[i].y = blocks[blocks[i].fundmention].y;
		switch(blocks[i].direct){
			case LEFT:
				blocks[i].x++;
				break;
			case DOWN:
				blocks[i].y++;
				break;
			case RIGHT:
				blocks[i].x--;
				break;
			case UP:
				blocks[i].y--;
				break;
		}
	}

	int w = std::max_element(blocks.begin(),blocks.end(),BLOCK::xPred)->x - std::min_element(blocks.begin(),blocks.end(),BLOCK::xPred)->x + 1;
	int h = std::max_element(blocks.begin(),blocks.end(),BLOCK::yPred)->y - std::min_element(blocks.begin(),blocks.end(),BLOCK::yPred)->y + 1;

	std::cout << w << ' ' << h << std::endl;
}

void A()
{
	int rowcount = GetRowCount();
	while(rowcount != 0){
		GetBoxRect(rowcount);
		rowcount = GetRowCount();
	}
}

int main()
{
A();
return 0;
}

Compiler output:
a.cc: In function 'void GetBoxRect(int)':
a.cc:39:9: error: 'memset' was not declared in this scope
   39 |         memset(&block,0,sizeof(BLOCK));
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <algorithm>
  +++ |+#include <cstring>
    5 |
Language: C++

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

//ツ債計ツ行ツ青板づーツ偲ヲツ督セ
int GetRowCount()
{
	int count;
	std::cin >> count;
	return count;
}


typedef enum{LEFT,DOWN,RIGHT,UP} DIRECTION;

typedef struct _BLOCK
{
	int fundmention;
	DIRECTION direct;
	int x,y;

	static bool xPred(struct _BLOCK left,struct _BLOCK right)
	{
		return left.x < right.x;
	}

		static bool yPred(struct _BLOCK left,struct _BLOCK right)
	{
		return left.y < right.y;
	}

} BLOCK;

void GetBoxRect(int rowcount){

	std::vector<BLOCK> blocks;
	BLOCK block;
	memset(&block,0,sizeof(BLOCK));
	blocks.push_back(block);

	for(int i = 0; i < rowcount - 1; i++){
		BLOCK block;
		std::cin >> block.fundmention >> (int &)block.direct;
		blocks.push_back(block);
	}

	for(int i = 1; i < rowcount; i++){
		blocks[i].x = blocks[blocks[i].fundmention].x;
		blocks[i].y = blocks[blocks[i].fundmention].y;
		switch(blocks[i].direct){
			case LEFT:
				blocks[i].x++;
				break;
			case DOWN:
				blocks[i].y++;
				break;
			case RIGHT:
				blocks[i].x--;
				break;
			case UP:
				blocks[i].y--;
				break;
		}
	}

	int w = std::max_element(blocks.begin(),blocks.end(),BLOCK::xPred)->x - std::min_element(blocks.begin(),blocks.end(),BLOCK::xPred)->x + 1;
	int h = std::max_element(blocks.begin(),blocks.end(),BLOCK::yPred)->y - std::min_element(blocks.begin(),blocks.end(),BLOCK::yPred)->y + 1;

	std::cout << w << ' ' << h << std::endl;
}

void A()
{
	int rowcount = GetRowCount();
	while(rowcount != 0){
		GetBoxRect(rowcount);
		rowcount = GetRowCount();
	}
}

int main()
{
	A();

	return 0;
}

Compiler output:
a.cc: In function 'void GetBoxRect(int)':
a.cc:38:9: error: 'memset' was not declared in this scope
   38 |         memset(&block,0,sizeof(BLOCK));
      |         ^~~~~~
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 <algorithm>
#include <cmath>
using namespace std;

int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};

int main() {
  int N,d,n,left,right,top,bottom;
  int pos[200][2];
  while(cin >> N) {
    if(N == 0) break;
    memset(pos,0,sizeof(pos));
    left = 0;right = 0;top = 0;bottom = 0;
    for(int i=1;i<N;i++) {
      cin >> n >> d;
      pos[i][0] = pos[n][0] + dx[d]; // x
      pos[i][1] = pos[n][1] + dy[d]; // y
      left = min(left,pos[i][0]);
      right = max(right,pos[i][0]);
      top = max(top,pos[i][1]);
      bottom = min(bottom,pos[i][1]);
    }
    cout << right - left + 1 << " " << top - bottom + 1 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'memset' was not declared in this scope
   14 |     memset(pos,0,sizeof(pos));
      |     ^~~~~~
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 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
int max_u;
int max_d;
int max_l;
int max_r;

struct square{
	int ud;
	int lr;
};

int main(void){
	square s[210];
	int a,b,n,i;
	while(cin >> n,n){
		max_u = 0;
		max_d = 0;
		max_l = 0;
		max_r = 0;
		s[0].ud = 0;
		s[0].lr = 0;

		for(i=1;i < n;i++){
			cin>>a>>b;

			memcpy(&s[i],&s[a],sizeof(square));
			if(b == 0){ if(--s[i].lr < max_l) max_l = s[i].lr;}
			else if(b == 1){ if(--s[i].ud < max_d) max_d = s[i].ud;}
			else if(b == 2){ if(++s[i].lr > max_r) max_r = s[i].lr;}
			else if(++s[i].ud > max_u) max_u = s[i].ud;
		}
	cout << max_r-max_l+1 << " " << max_u-max_d+1 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:25: error: 'memcpy' was not declared in this scope
   27 |                         memcpy(&s[i],&s[a],sizeof(square));
      |                         ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
int max_u,max_d,max_l,max_r;

struct square{
	int ud,lr;
};

int main(){
	square s[210];
	int a,b,n,i;
	while(cin >> n,n){
		max_u = 0;
		max_d = 0;
		max_l = 0;
		max_r = 0;
		s[0].ud = 0;
		s[0].lr = 0;

		for(i=1;i < n;i++){
			cin>>a>>b;

			memcpy(&s[i],&s[a],sizeof(square));
			if(b == 0){
				if(--s[i].lr < max_l) max_l = s[i].lr;
			}
			else if(b == 1){
				if(--s[i].ud < max_d) max_d = s[i].ud;
			}
			else if(b == 2){
		 		if(++s[i].lr > max_r) max_r = s[i].lr;
			}
			else if(++s[i].ud > max_u) max_u = s[i].ud;
		}
	cout << max_r-max_l+1 << " " << max_u-max_d+1 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: 'memcpy' was not declared in this scope
   23 |                         memcpy(&s[i],&s[a],sizeof(square));
      |                         ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<map>

using namespace std;

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

typedef __int64 ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pii;

int main(){
	A:;
	
	int n;
	cin>>n;
	if(n==0)return 0;
	
	map<int,pii> box;
	box[0] = pii(0,0);
	
	int minix = 0;
	int maxix = 0;
	int miniy = 0;
	int maxiy = 0;
	
	reps(i,1,n){
		int a,b;
		cin>>a>>b;
		int dx[]={-1,0,1,0};
		int dy[]={0,1,0,-1};
		
		int x = box[a].first;
		int y = box[a].second;
		
		int nx = x+dx[b];
		int ny = y+dy[b];
		
		minix = min(minix, nx);
		miniy = min(miniy, ny);
		maxix = max(maxix, nx);
		maxiy = max(maxiy, ny);
		
		box[i] = pii(nx,ny);
	}
	
	printf("%d %d\n",(maxix-minix+1),(maxiy-miniy+1));
	
	goto A;
}

Compiler output:
a.cc:14:9: error: '__int64' does not name a type; did you mean '__int64_t'?
   14 | typedef __int64 ll;
      |         ^~~~~~~
      |         __int64_t
Language: C++

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

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

	const int dx[4] = {-1, 0, 1, 0};
	const int dy[4] = {0, -1, 0, 1};

	for(int n; cin >> n, n;) {
		vector<int> x(n, 0), y(n, 0);

		for(int i = 1; i < n; ++i) {
			int idx, d;
			cin >> idx >> d;
			x[i] = x[idx] + dx[d];
			y[i] = y[idx] + dy[d];
		}

		const int width = *max_element(x.begin(), x.end()) - *min_element(x.begin(), x.end()) + 1;
		const int height = *max_element(y.begin(), y.end()) - *min_element(y.begin(), y.end()) + 1;
		cout << width << " " << height << endl;
	}

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:36: error: 'max_element' was not declared in this scope
   23 |                 const int width = *max_element(x.begin(), x.end()) - *min_element(x.begin(), x.end()) + 1;
      |                                    ^~~~~~~~~~~
a.cc:23:71: error: 'min_element' was not declared in this scope
   23 |                 const int width = *max_element(x.begin(), x.end()) - *min_element(x.begin(), x.end()) + 1;
      |                                                                       ^~~~~~~~~~~
Language: C++

			if(dir==0){
				if(x[0].find(tgt)!=x[0].end()){
					set<int> ins;
					ins.insert(i);
					x.push_back(ins);
					y.push_back(ins);
				}else{
					for(int j=1;j<x.size()-1;j++){
						if(x[j].find(tgt)!=x[j].end){
							x[j-1].insert(i);
							break;
						}
					}
				}
			}else if(dir==2){
				if(x[x.size()-1].find(tgt)!=x[x.size()-1].end()){
					set<int> ins;
					ins.insert(i);
					x.push_back(ins);
				}else{
					for(int j=0;j<x.size-2;j++){
						if(x[j].find(tgt)!=x[j].end()){
							x[j+1].insert(i);
							break;
						}
					}
				}
			}else{
				for(int j=0;j<x.size()-1;j++){
					if(x[j].find(tgt)!=x.[j].end()){
						x[j].insert(i);
					}
				}
			}

Compiler output:
a.cc:1:25: error: expected unqualified-id before 'if'
    1 |                         if(dir==0){
      |                         ^~
a.cc:15:26: error: expected unqualified-id before 'else'
   15 |                         }else if(dir==2){
      |                          ^~~~
a.cc:28:26: error: expected unqualified-id before 'else'
   28 |                         }else{
      |                          ^~~~
Language: C++

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int n = sc.nextInt();
			if (n == 0)
				break;
			int[] x = new int[n];
			int[] y = new int[n];
			x[0] = 0;
			y[0] = 0;
			for (int i = 1; i < n; i++) {
				int p = sc.nextInt();
				int d = sc.nextInt();
				switch (d) {
				case 0:
					x[i] = x[p] - 1;
					y[i] = y[p];
					break;
				case 1:
					x[i] = x[p];
					y[i] = y[p] - 1;
					break;
				case 2:
					x[i] = x[p] + 1;
					y[i] = y[p];
					break;
				case 3:
					x[i] = x[p];
					y[i] = y[p] + 1;
					break;
				}
			}
			int xmax = 0, xmin = 0, ymax = 0, ymin = 0;
			for (int i = 1; i < n; i++) {
				xmax = Math.max(xmax, x[i]);
				xmin = Math.min(xmin, x[i]);
				ymax = Math.max(ymax, y[i]);
				ymin = Math.min(ymin, y[i]);
			}
			int w = xmax - xmin + 1;
			int h = ymax - ymin + 1;
			System.out.println(w + " " + h);
		}
		sc.close();
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: Java

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int x, y;
		int w, h;
		int[][] u;
		int[][] d;
		int[][] l;
		int[][] r;
		int[][] dist;
		int[][] flag;

		while(true){
			w = sc.nextInt();
			h = sc.nextInt();
			if(w == 0 && h == 0)
				break;

			u = new int[h][w];
			d = new int[h][w];
			l = new int[h][w];
			r = new int[h][w];
			dist = new int[h][w];
			flag = new int[h][w];

			for(int i = 0; i < h; i++){
				l[i][0] = 1;
				r[i][w-1] = 1;
			}
			for(int j = 0; j < w; j++){
				u[0][j] = 1;
				d[h-1][j] = 1;
			}

			for(int i = 0; i < h; i++){
				for(int j = 0; j < w-1; j++){
					r[i][j] = sc.nextInt();
					l[i][j+1] = r[i][j];
				}
				if(i == h - 1)
					continue;
				for(int j = 0; j < w; j++){
					d[i][j] = sc.nextInt();
					u[i+1][j] = d[i][j];
				}
			}
			Queue xQueue = new Queue(w * h);
			Queue yQueue = new Queue(w * h);
			xQueue.enqueue(0);
			yQueue.enqueue(0);

			while(!xQueue.isEmpty()){
				x = xQueue.dequeue();
				y = yQueue.dequeue();
				if(x == h-1 && y == w-1){
					System.out.println(dist[x][y]);
					break;
				}
				if(d[x][y] == 0 && flag[x+1][y] == 0){
					xQueue.enqueue(x+1);
					yQueue.enqueue(y);
					dist[x+1][y] = dist[x][y] + 1;
					flag[x+1][y] = 1;
				}
				if(r[x][y] == 0 && flag[x][y+1] == 0){
					xQueue.enqueue(x);
					yQueue.enqueue(y+1);
					dist[x][y+1] = dist[x][y] + 1;
					flag[x][y+1] = 1;
				}
				if(u[x][y] == 0 && flag[x-1][y] == 0){
					xQueue.enqueue(x-1);
					yQueue.enqueue(y);
					dist[x-1][y] = dist[x][y] + 1;
					flag[x-1][y] = 1;
				}
				if(l[x][y] == 0 && flag[x][y-1] == 0){
					xQueue.enqueue(x);
					yQueue.enqueue(y-1);
					dist[x][y-1] = dist[x][y] + 1;
					flag[x][y-1] = 1;
				}
			}
		}
	}
}
public class Queue{
	int SIZE;
	int head = 0;
	int tail = 0;
	int[] val = new int[SIZE];

	Queue(int iSIZE){
		SIZE = iSIZE;
	}

	int next(int index){
		return (index+1)%SIZE;
	}

	boolean isEmpty(){
		return (head == tail);
	}

	boolean enqueue(int data){
		if(next(tail) == head)
			return false;
		else{
			val[tail] = data;
			tail = next(tail);
			return true;
		}
	}

	int dequeue(){
		int data;
		if(isEmpty() == true){
			data = -1;
		}else{
			data = val[head];
			head = next(head);
		}
		return data;
	}
}

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

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int x, y;
		int w, h;
		int[][] u;
		int[][] d;
		int[][] l;
		int[][] r;
		int[][] dist;
		int[][] flag;

		while(true){
			w = sc.nextInt();
			h = sc.nextInt();
			if(w == 0 && h == 0)
				break;

			u = new int[h][w];
			d = new int[h][w];
			l = new int[h][w];
			r = new int[h][w];
			dist = new int[h][w];
			flag = new int[h][w];

			for(int i = 0; i < h; i++){
				l[i][0] = 1;
				r[i][w-1] = 1;
			}
			for(int j = 0; j < w; j++){
				u[0][j] = 1;
				d[h-1][j] = 1;
			}

			for(int i = 0; i < h; i++){
				for(int j = 0; j < w-1; j++){
					r[i][j] = sc.nextInt();
					l[i][j+1] = r[i][j];
				}
				if(i == h - 1)
					continue;
				for(int j = 0; j < w; j++){
					d[i][j] = sc.nextInt();
					u[i+1][j] = d[i][j];
				}
			}
			Queue xQueue = new Queue(w * h);
			Queue yQueue = new Queue(w * h);
			xQueue.enqueue(0);
			yQueue.enqueue(0);

			while(!xQueue.isEmpty()){
				x = xQueue.dequeue();
				y = yQueue.dequeue();
				if(x == h-1 && y == w-1){
					System.out.println(dist[x][y]);
					break;
				}
				if(d[x][y] == 0 && flag[x+1][y] == 0){
					xQueue.enqueue(x+1);
					yQueue.enqueue(y);
					dist[x+1][y] = dist[x][y] + 1;
					flag[x+1][y] = 1;
				}
				if(r[x][y] == 0 && flag[x][y+1] == 0){
					xQueue.enqueue(x);
					yQueue.enqueue(y+1);
					dist[x][y+1] = dist[x][y] + 1;
					flag[x][y+1] = 1;
				}
				if(u[x][y] == 0 && flag[x-1][y] == 0){
					xQueue.enqueue(x-1);
					yQueue.enqueue(y);
					dist[x-1][y] = dist[x][y] + 1;
					flag[x-1][y] = 1;
				}
				if(l[x][y] == 0 && flag[x][y-1] == 0){
					xQueue.enqueue(x);
					yQueue.enqueue(y-1);
					dist[x][y-1] = dist[x][y] + 1;
					flag[x][y-1] = 1;
				}
			}
			if(x != h-1 || y != w-1)
				System.out.println(0);
		}
	}
}
class Queue{
	int SIZE;
	int head = 0;
	int tail = 0;
	int[] val = new int[SIZE];

	Queue(int iSIZE){
		SIZE = iSIZE;
	}

	int next(int index){
		return (index+1)%SIZE;
	}

	boolean isEmpty(){
		return (head == tail);
	}

	boolean enqueue(int data){
		if(next(tail) == head)
			return false;
		else{
			val[tail] = data;
			tail = next(tail);
			return true;
		}
	}

	int dequeue(){
		int data;
		if(isEmpty() == true){
			data = -1;
		}else{
			data = val[head];
			head = next(head);
		}
		return data;
	}
}

Compiler output:
Main.java:86: error: variable x might not have been initialized
			if(x != h-1 || y != w-1)
			   ^
Main.java:86: error: variable y might not have been initialized
			if(x != h-1 || y != w-1)
			               ^
2 errors
Language: Java

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int x = 0;
		int y = 0;
		int w, h;
		int[][] u;
		int[][] d;
		int[][] l;
		int[][] r;
		int[][] dist;
		int[][] flag;

		while(true){
			w = sc.nextInt();
			h = sc.nextInt();
			if(w == 0 && h == 0)
				break;

			u = new int[h][w];
			d = new int[h][w];
			l = new int[h][w];
			r = new int[h][w];
			dist = new int[h][w];
			flag = new int[h][w];

			for(int i = 0; i < h; i++){
				l[i][0] = 1;
				r[i][w-1] = 1;
			}
			for(int j = 0; j < w; j++){
				u[0][j] = 1;
				d[h-1][j] = 1;
			}
			for(int i = 0; i < h; i++){
				for(int j = 0; j < w-1; j++){
					r[i][j] = sc.nextInt();
					l[i][j+1] = r[i][j];
				}
				if(i == h - 1)
					continue;
				for(int j = 0; j < w; j++){
					d[i][j] = sc.nextInt();
					u[i+1][j] = d[i][j];
				}
			}

			Queue xQueue = new Queue(w * h);
			Queue yQueue = new Queue(w * h);
			xQueue.enqueue(0);
			yQueue.enqueue(0);

			while(!xQueue.isEmpty()){
				x = xQueue.dequeue();
				y = yQueue.dequeue();
				if(x == h-1 && y == w-1){
					System.out.println(dist[x][y]);
					break;
				}
				if(d[x][y] == 0 && flag[x+1][y] == 0){
					xQueue.enqueue(x+1);
					yQueue.enqueue(y);
					dist[x+1][y] = dist[x][y] + 1;
					flag[x+1][y] = 1;
				}
				if(r[x][y] == 0 && flag[x][y+1] == 0){
					xQueue.enqueue(x);
					yQueue.enqueue(y+1);
					dist[x][y+1] = dist[x][y] + 1;
					flag[x][y+1] = 1;
				}
				if(u[x][y] == 0 && flag[x-1][y] == 0){
					xQueue.enqueue(x-1);
					yQueue.enqueue(y);
					dist[x-1][y] = dist[x][y] + 1;
					flag[x-1][y] = 1;
				}
				if(l[x][y] == 0 && flag[x][y-1] == 0){
					xQueue.enqueue(x);
					yQueue.enqueue(y-1);
					dist[x][y-1] = dist[x][y] + 1;
					flag[x][y-1] = 1;
				}
			}
			if(x != h-1 || y != w-1)
				System.out.println(0);
		}
	}
}
public class Queue{
	int SIZE;
	int head = 0;
	int tail = 0;
	int[] val = new int[SIZE];

	Queue(int iSIZE){
		SIZE = iSIZE;
	}

	int next(int index){
		return (index+1)%SIZE;
	}

	boolean isEmpty(){
		return (head == tail);
	}

	boolean enqueue(int data){
		if(next(tail) == head)
			return false;
		else{
			val[tail] = data;
			tail = next(tail);
			return true;
		}
	}

	int dequeue(){
		int data;
		if(isEmpty() == true){
			data = -1;
		}else{
			data = val[head];
			head = next(head);
		}
		return data;
	}
}

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

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

import static java.lang.Integer.parseInt;

/**
 * Amazing Mazes
 */
public class P1166 {

	static final int DIR[][] = {
			{0, -1},
			{1, 0},
			{0, 1},
			{-1, 0},
	};

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

		while ((line = br.readLine()) != null && !line.isEmpty()) {
			int w, h;
			w = parseInt(line.substring(0, line.indexOf(' ')));
			h = parseInt(line.substring(line.indexOf(' ') + 1));
			if ((w | h) == 0) break;

			int[][] maze = new int[h][w];
			int[][] moveH = new int[h][w - 1];
			int[][] moveV = new int[h - 1][w];

			for (int i = 0; i < 2 * h - 1; i++) {
				line = br.readLine();
				if (i % 2 == 0) {
					StringTokenizer st = new StringTokenizer(line.substring(1));
					for (int j = 0; j < moveH[0].length; j++) {
						moveH[i / 2][j] = parseInt(st.nextToken());
					}
				} else {
					StringTokenizer st = new StringTokenizer(line);
					for (int j = 0; j < moveV[0].length; j++) {
						moveV[i / 2][j] = parseInt(st.nextToken());
					}
				}
			}

			//solve
			Deque<int[]> q = new ArrayDeque<>();

			q.offer(new int[]{0, 0});
			maze[0][0] = 1;

			while (!q.isEmpty()) {

				int y, x;
				y = q.peek()[0];
				x = q.peek()[1];
				q.poll();

				if (y == h - 1 && x == w - 1) break;

				for (int i = 0; i < DIR.length; i++) {
					int ny, nx;
					ny = y + DIR[i][0];
					nx = x + DIR[i][1];
					if (0 <= ny && ny < h && 0 <= nx && nx < w && maze[ny][nx] == 0) {
						if (i % 2 == 0 && moveH[ny][(nx + x) / 2] == 1) {
							continue;
						} else if (i % 2 != 0 && moveV[(ny + y) / 2][nx] == 1) {
							continue;
						}
						q.offer(new int[]{ny, nx});
						maze[ny][nx] = maze[y][x] + 1;
					}
				}
			}
			System.out.println(maze[h - 1][w - 1]);
		}
	}
}

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

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int w = sc.nextInt();
			int h = sc.nextInt();
			if(w==0 && h==0) break;
			int[][] s_wall = new int [h][w+1];
			int[][] u_wall = new int [h+1][w];
			for(int i=0;i<h;++i) {
				s_wall[i][0]=1;
				for(int j=1;j<w;++j){
					s_wall[i][j] = sc.nextInt();
				}
				s_wall[i][w] = 1;
				if(i==h-1) {
					for(int j=0;j<w;++j) {
						u_wall[0][j] = 1;
						u_wall[i+1][j] = 1;
					}
				} else {
					for(int j=0;j<w;++j) {
						u_wall[i+1][j] = sc.nextInt();
					}
				}
			}
			int[][] map = new int[h][w];
			Queue<Node> que = new LinkedList<Node>();
			map[0][0]=1;
			que.add(new Node(0,0));
			while(!que.isEmpty()) {
				Node cur = que.remove();
				if(cur.y!=0 && u_wall[cur.y][cur.x]==0) {
					if(map[cur.y-1][cur.x]==0 || map[cur.y-1][cur.x]>map[cur.y][cur.x]) {
						que.add(new Node(cur.x,cur.y-1));
						map[cur.y-1][cur.x]=map[cur.y][cur.x]+1;
					}
				}
				if(cur.y!=h-1 && u_wall[cur.y+1][cur.x]==0) {
					if(map[cur.y+1][cur.x]==0 || map[cur.y+1][cur.x]>map[cur.y][cur.x]) {
						que.add(new Node(cur.x,cur.y+1));
						map[cur.y+1][cur.x]=map[cur.y][cur.x]+1;
					}
				}
				if(cur.x!=0 && s_wall[cur.y][cur.x]==0) {
					if(map[cur.y][cur.x-1]==0 || map[cur.y][cur.x-1]>map[cur.y][cur.x]) {
						que.add(new Node(cur.x-1,cur.y));
						map[cur.y][cur.x-1]=map[cur.y][cur.x]+1;
					}
				}
				if(cur.x!=w-1 && s_wall[cur.y][cur.x+1]==0) {
					if(map[cur.y][cur.x+1]==0 || map[cur.y][cur.x+1]>map[cur.y][cur.x]) {
						que.add(new Node(cur.x+1,cur.y));
						map[cur.y][cur.x+1]=map[cur.y][cur.x]+1;
					}
				}
			}
			System.out.println(map[h-1][w-1]);
		}
	}
}



Compiler output:
Main.java:32: error: cannot find symbol
			Queue<Node> que = new LinkedList<Node>();
			      ^
  symbol:   class Node
  location: class Main
Main.java:32: error: cannot find symbol
			Queue<Node> que = new LinkedList<Node>();
			                                 ^
  symbol:   class Node
  location: class Main
Main.java:34: error: cannot find symbol
			que.add(new Node(0,0));
			            ^
  symbol:   class Node
  location: class Main
Main.java:36: error: cannot find symbol
				Node cur = que.remove();
				^
  symbol:   class Node
  location: class Main
Main.java:39: error: cannot find symbol
						que.add(new Node(cur.x,cur.y-1));
						            ^
  symbol:   class Node
  location: class Main
Main.java:45: error: cannot find symbol
						que.add(new Node(cur.x,cur.y+1));
						            ^
  symbol:   class Node
  location: class Main
Main.java:51: error: cannot find symbol
						que.add(new Node(cur.x-1,cur.y));
						            ^
  symbol:   class Node
  location: class Main
Main.java:57: error: cannot find symbol
						que.add(new Node(cur.x+1,cur.y));
						            ^
  symbol:   class Node
  location: class Main
8 errors
Language: Java

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Main　{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int w = sc.nextInt();
			int h = sc.nextInt();
			if(w==0 && h==0) break;
			int[][] s_wall = new int [h][w+1];
			int[][] u_wall = new int [h+1][w];
			for(int i=0;i<h;++i) {
				s_wall[i][0]=1;
				for(int j=1;j<w;++j){
					s_wall[i][j] = sc.nextInt();
				}
				s_wall[i][w] = 1;
				if(i==h-1) {
					for(int j=0;j<w;++j) {
						u_wall[0][j] = 1;
						u_wall[i+1][j] = 1;
					}
				} else {
					for(int j=0;j<w;++j) {
						u_wall[i+1][j] = sc.nextInt();
					}
				}
			}
			int[][] map = new int[h][w];
			Queue<Node> que = new LinkedList<Node>();
			map[0][0]=1;
			que.add(new Node(0,0));
			while(!que.isEmpty()) {
				Node cur = que.remove();
				if(cur.y!=0 && u_wall[cur.y][cur.x]==0) {
					if(map[cur.y-1][cur.x]==0) {
						que.add(new Node(cur.x,cur.y-1));
						map[cur.y-1][cur.x]=map[cur.y][cur.x]+1;
					}
				}
				if(cur.y!=h-1 && u_wall[cur.y+1][cur.x]==0) {
					if(map[cur.y+1][cur.x]==0) {
						que.add(new Node(cur.x,cur.y+1));
						map[cur.y+1][cur.x]=map[cur.y][cur.x]+1;
					}
				}
				if(cur.x!=0 && s_wall[cur.y][cur.x]==0) {
					if(map[cur.y][cur.x-1]==0) {
						que.add(new Node(cur.x-1,cur.y));
						map[cur.y][cur.x-1]=map[cur.y][cur.x]+1;
					}
				}
				if(cur.x!=w-1 && s_wall[cur.y][cur.x+1]==0) {
					if(map[cur.y][cur.x+1]==0) {
						que.add(new Node(cur.x+1,cur.y));
						map[cur.y][cur.x+1]=map[cur.y][cur.x]+1;
					}
				}
			}
			System.out.println(map[h-1][w-1]);
		}
	}
	public static class Node {
		int x;
		int y;
		Node(int x, int y){
			this.x = x;
			this.y = y;
		}
	}
}



Compiler output:
Main.java:5: error: illegal character: '\u3000'
public class Main?{
                 ^
1 error
Language: Java

import java.util.*;

public class Main {

	int w, h, m, n;
	boolean[][] field;

	class Pos{
		int x, y, cnt;
		Pos(int x, int y, int cnt){
			this.x = x;
			this.y = y;
			this.cnt = cnt;
		}
	}

	void Search(){
		Queue<Pos> Q = new LinkedList<Pos>();
		Q.offer(new Pos(0,0,1));
		while(!Q.isEmpty()){
			Pos now = Q.poll();
			if(m-1==now.x&&n-1==now.y){
				System.out.println(now.cnt);
				return;
			}
			if(now.x+2<m&&field[now.x+1][now.y]){
				Q.offer(new Pos(now.x+2,now.y,now.cnt+1));
				field[now.x+1][now.y] = false; 
			}
			if(now.y+2<n&&field[now.x][now.y+1]){
				Q.offer(new Pos(now.x,now.y+2,now.cnt+1));
				field[now.x][now.y+1] = false;
			}
			if(now.x-2>=0&&field[now.x-1][now.y]){
				Q.offer(new Pos(now.x-2,now.y,now.cnt+1));
				field[now.x-1][now.y] = false;
			}
			if(now.y-2>=0&&field[now.x][now.y-1]){
				Q.offer(new Pos(now.x,now.y-2,now.cnt+1));
				field[now.x][now.y-1] = false;
			}
		}
		System.out.println("0");
	}

	void run(){
		Scanner stdIn = new Scanner(System.in);
		while(true){
			w = stdIn.nextInt();
			h = stdIn.nextInt();
			if(w==0&&h==0){
				return;
			}
			m = h*2-1;
			n = w*2-1;
			field = new boolean[m][n];
			for(int i=0;i<m;i++){
				for(int j=0;j<n;j++){
					if((i+j)%2==0){
						continue;
					}
					if(stdIn.nextInt()==0){
						field[i][j] = true;
					}
				}	
			}
			Search();
		}
	}

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

Compiler output:
Main.java:72: error: cannot find symbol
		new AOJ1166().run();
		    ^
  symbol:   class AOJ1166
  location: class Main
1 error