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

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

#define size_max 100+10

#define Y first
#define X second

int mx[4] = { 1,-1,0,0 };
int my[4] = { 0,0,1,-1 };

int map[size_max][size_max];


void paint(int c, int y, int x, int H, int W)
{
	int i, j;
	for (i = y; i < y + H; i++)
	{
		for (j = x; j < x + W; j++)
		{
			map[i][j] = c;
		}
	}
}


void chek(int w, int h)
{
	int i, j;
	for (i = 0; i <= h + 1; i++)
	{
		for (j = 0; j <= w + 1; j++)
		{
			cout << map[i][j];
		}
		cout << endl;
	}
}


typedef pair<int, int> PR;

int main(void)
{
	PR now, tmp;
	queue<PR> QU;

	int w, h;
	int xs, ys, xg, yg, n;
	int c, d, set_x, set_y;

	int i, j;

	while ((cin >> w >> h), w != 0 && h != 0)
	{
		memset(map, 0, sizeof map);

		cin >> xs >> ys >> xg >> yg >> n;

		for (i = 0; i < n; i++)
		{
			cin >> c >> d >> set_x >> set_y;

			if (d == 0)
			{
				paint(c, set_y, set_x, 2, 4);
			}
			else
			{
				paint(c, set_y, set_x, 4, 2);
			}
		}

		//chek(w, h);

		if (map[ys][xs] == 0)
		{
			cout << "NG\n";
			continue;
		}

		now = make_pair(ys, xs);
		QU.push(now);

		bool goal = false;
		while (!QU.empty())
		{
			now = QU.front();
			QU.pop();

			if (map[now.Y][now.X] != -1)
			{
				map[now.Y][now.X] = -1;

				if (now.Y == yg && now.X == xg)
				{
					goal = true;
					while (!QU.empty())
					{
						QU.pop();
					}
					break;
				}

				for (i = 0; i < 4; i++)
				{
					if (map[now.Y + my[i]][now.X + mx[i]] == c)
					{
						tmp = make_pair(now.Y + my[i], now.X + mx[i]);
						QU.push(tmp);
					}
				}
			}
		}

		if (goal)
		{
			cout << "OK\n";
		}
		else
		{
			cout << "NG\n";
		}

	}

	return 0;
}


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

include<iostream>
using namespace std;
#define MAX_H 100
#define MAX_W 100
#define INF 1000;
int h,w;
int field[MAX_H][MAX_W];
int dx[4]={0,-1,0,1},dy[4]={-1,0,1,0};
void dfs(int y,int x,const int sc){
	if(y<=0 || x<=0 || y>h || x>w)return;
	if(field[y][x]==sc){
		field[y][x]=0;
		for(int i=0;i<4;i++)dfs(y+dy[i],x+dx[i],sc);
	}
	return;
}
int main(){
	int sx,sy,gx,gy,n;
	while(cin>>w>>h){
        if(!w && !h)break;
		cin>>sx>>sy>>gx>>gy>>n;
		for(int i=0;i<MAX_H;i++){
			for(int j=0;j<MAX_W;j++){
					field[i][j]=INF;
				}
		}
		while(n--){
			int c,d,x,y;
			cin>>c>>d>>x>>y;
			for(int i=0;i<2;i++){
				for(int j=0;j<4;j++){
					if(d)field[y+j][x+i]=c;
					else field[y+i][x+j]=c;	
				}	
			}	
		}
		dfs(sy,sx,field[sy][sx]);		
		if(field[gy][gx])cout<<"NG"<<endl;
		else cout<<"OK"<<endl;
		
	}
	return 0;
}  

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:19:15: error: 'cin' was not declared in this scope
   19 |         while(cin>>w>>h){
      |               ^~~
a.cc:38:34: error: 'cout' was not declared in this scope
   38 |                 if(field[gy][gx])cout<<"NG"<<endl;
      |                                  ^~~~
a.cc:38:46: error: 'endl' was not declared in this scope
   38 |                 if(field[gy][gx])cout<<"NG"<<endl;
      |                                              ^~~~
a.cc:39:22: error: 'cout' was not declared in this scope
   39 |                 else cout<<"OK"<<endl;
      |                      ^~~~
a.cc:39:34: error: 'endl' was not declared in this scope
   39 |                 else cout<<"OK"<<endl;
      |                                  ^~~~
Language: C++

def g;gets.split.map &:to_i;end
while(w,h=g)[0]>0
t,u=s=g;e=g
m=[v=[6]*(w+2)]+(1..h).map{[6]+[0]*w<<6}<<v
g[0].times{c,d,x,y=g;o=d<1?4:2;m[y,6-o].map{|i|i[x,o]=[c]*o}}
q=[s]
c=m[t][u]
(q.uniq!;a,b=q.shift;m[a][b]=7;[[a,b+1],[a,b-1],[a+1,b],[a-1,b]].map{|i,j|m[i][j]==c&&q<<[i,j]})while q[0]&&q[0]!=e
puts q[0]?:OK:"NG"end

Compiler output:
a.cc:4:18: error: too many decimal points in number
    4 | m=[v=[6]*(w+2)]+(1..h).map{[6]+[0]*w<<6}<<v
      |                  ^~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def g;gets.split.map &:to_i;end
      | ^~~
a.cc:1:7: error: 'gets' does not name a type
    1 | def g;gets.split.map &:to_i;end
      |       ^~~~
a.cc:1:29: error: 'end' does not name a type
    1 | def g;gets.split.map &:to_i;end
      |                             ^~~
a.cc:3:9: error: 'e' does not name a type
    3 | t,u=s=g;e=g
      |         ^
a.cc:4:41: error: expected unqualified-id before '<<' token
    4 | m=[v=[6]*(w+2)]+(1..h).map{[6]+[0]*w<<6}<<v
      |                                         ^~
a.cc:6:1: error: 'q' does not name a type
    6 | q=[s]
      | ^
a.cc:8:10: error: 'a' does not name a type
    8 | (q.uniq!;a,b=q.shift;m[a][b]=7;[[a,b+1],[a,b-1],[a+1,b],[a-1,b]].map{|i,j|m[i][j]==c&&q<<[i,j]})while q[0]&&q[0]!=e
      |          ^
a.cc:8:22: error: 'm' does not name a type
    8 | (q.uniq!;a,b=q.shift;m[a][b]=7;[[a,b+1],[a,b-1],[a+1,b],[a-1,b]].map{|i,j|m[i][j]==c&&q<<[i,j]})while q[0]&&q[0]!=e
      |                      ^
a.cc:8:37: error: expected ']' before '+' token
    8 | (q.uniq!;a,b=q.shift;m[a][b]=7;[[a,b+1],[a,b-1],[a+1,b],[a-1,b]].map{|i,j|m[i][j]==c&&q<<[i,j]})while q[0]&&q[0]!=e
      |                                     ^
      |                                     ]
a.cc:8:96: error: expected unqualified-id before ')' token
    8 | (q.uniq!;a,b=q.shift;m[a][b]=7;[[a,b+1],[a,b-1],[a+1,b],[a-1,b]].map{|i,j|m[i][j]==c&&q<<[i,j]})while q[0]&&q[0]!=e
      |                                                                                                ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int w,h,xs,ys,xg,yg,n,ban[101][101]={{0},{0}};
const int START=4545191;
const int GOAL=454545;
const int CHECKED=432535;

	bool dfs(int x,int y,int c){
		//cout<<x<<" "<<y<<endl;
		if(ban[x][y+1]==CHECKED&&ban[x+1][y]==CHECKED)return false;
		if(xg==x&&yg==y)return true;
		if(ban[x+1][y]==c){
			ban[x+1][y]=CHECKED;
			if(dfs(x+1,y,c))return true;
		}
		if(ban[x][y+1]==c){
			ban[x][y+1]=CHECKED;
			if(dfs(x,y+1,c))return true;
		}
		return false;
	}


int main(){

	while(cin>>w>>h&&w&&h){
	cin>>xs>>ys>>xg>>yg>>n;
	for(int i=0;i<101;i++)
	for(int j=0;j<101;j++)ban[i][j]=0;
	for(int i=0;i<n;i++){
		int c,d,x,y;
		cin>>c>>d>>x>>y;
		if(!d){
			for(int i=x;i<x+4;i++){
				for(int j=y;j<y+2;j++){
					ban[i][j]=c;
				}
			}
		}
		else{
		for(int i=x;i<x+2;i++){
				for(int j=y;j<y+4;j++){
					ban[i][j]=c;
				}
			}
		}
	}
	if(dfs(xs,ys,ban[xs][ys]))cout<<"OK"<<endl;
	else cout<<"NG"<<endl;
	
	return 0;
	}

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

#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int w,h,xs,ys,xg,yg,n,ban[111][111]={{0},{0}};
bool visited [101][101];
const int START=4545191;
const int GOAL=454545;

	bool dfs(int x,int y){
		//cout<<x<<" "<<y<<endl;
		if(xg==x&&yg==y)return true;
		
		if(ban[x+1][y]==ban[xs][ys]&&visited[x][y]==false){
			visited[x][y]=true;
			if(dfs(x+1,y))return true;
		}
		if(ban[x][y+1]==ban[xs][ys]&&visited[x][y]==false){
			visited[x][y]=true;
			if(dfs(x,y+1))return true;
		}
		if(x>=2&&ban[x-1][y]==ban[xs][y]&&visited[x][y]==false){
			visited[x][y]=true;
			if(dfs(x-1,y))return true;
		}
		if(y>=2&&ban[x][y-1]==ban[xs][y]&&visited[x][y]=false;){
			visited[x][y]=true;
			if(dfs(x,y-1))return true;
		}
		return false;
	}


int main(){

	while(cin>>w>>h&&w&&h){
	cin>>xs>>ys>>xg>>yg>>n;
	for(int i=0;i<101;i++)
	for(int j=0;j<101;j++)ban[i][j]=0,visited[i][j]=false;
	
	for(int i=0;i<n;i++){
		int c,d,x,y;
		cin>>c>>d>>x>>y;
		if(!d){
			for(int i=x;i<x+4;i++){
				for(int j=y;j<y+2;j++){
					ban[i][j]=c;
				}
			}
		}
		else{
		for(int i=x;i<x+2;i++){
				for(int j=y;j<y+4;j++){
					ban[i][j]=c;
				}
			}
		}
	}
	
	if(dfs(xs,ys))cout<<"OK"<<endl;
	else cout<<"NG"<<endl;
	}
	return 0;
	}

Compiler output:
a.cc: In function 'bool dfs(int, int)':
a.cc:26:49: error: lvalue required as left operand of assignment
   26 |                 if(y>=2&&ban[x][y-1]==ban[xs][y]&&visited[x][y]=false;){
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
a.cc:26:71: error: expected primary-expression before ')' token
   26 |                 if(y>=2&&ban[x][y-1]==ban[xs][y]&&visited[x][y]=false;){
      |                                                                       ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
	using namespace std;
	int xs,ys,w,h,n,ban[111][111],xg,yg;bool visited[101][101];
	bool dfs(int x,int y,int c){
		//cout<<x<<" "<<y<<endl;
				if(c-1||ban[x][y]!=c)return false;
		if(xg==x&&yg==y)return true;
		//if(ban[xs][ys]==0)return false;
		if(ban[x+1][y]==c&&visited[x+1][y]==false){
			visited[x+1][y]=true;
			if(dfs(x+1,y,c))return true;
		}
		if(ban[x][y+1]==c&&visited[x][y+1]==false){
			visited[x][y+1]=true;
			if(dfs(x,y+1,c))return true;
		}
		if(x>=2&&ban[x-1][y]==c&&visited[x-1][y]==false){
			visited[x-1][y]=true;
			if(dfs(x-1,y,c))return true;
		}
		if(y>=2&&ban[x][y-1]=c&&visited[x][y-1]==false){
			visited[x][y-1]=true;
			if(dfs(x,y-1,c))return true;
		}
		return false;
	}


int main(){

	while(cin>>w>>h&&w&&h){
	cin>>xs>>ys>>xg>>yg>>n;
	for(int i=0;i<101;i++)
	for(int j=0;j<101;j++)ban[i][j]=-1,visited[i][j]=false;
	
	for(int i=0;i<n;i++){
		int c,d,x,y;
		cin>>c>>d>>x>>y;
		if(!d){
			for(int i=x;i<x+4;i++){
				for(int j=y;j<y+2;j++){
					ban[i][j]=c;
				}
			}
		}
		else{
		for(int i=x;i<x+2;i++){
				for(int j=y;j<y+4;j++){
					ban[i][j]=c;
				}
			}
		}
		}
		if(dfs(xs,ys,ban[xs][ys]))cout<<"OK"<<endl;
	else cout<<"NG"<<endl;
	}
	return 0;
	}

Compiler output:
a.cc: In function 'bool dfs(int, int, int)':
a.cc:23:24: error: lvalue required as left operand of assignment
   23 |                 if(y>=2&&ban[x][y-1]=c&&visited[x][y-1]==false){
      |                    ~~~~^~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int fie[101][101],ans,gol[101][101],st[101][101],col,muki,bx,by;
int bex[4]={0,1,0,-1},bey[4]={1,0,-1,0},cou,a,b;
    int sx,sy,gx,gy,n;
int func(int y,int x){
    if(fie[sy][sx]==-1)return 0;
    if(y<1||x<1||y>b||x>a)return 0;
    if(fie[y][x]==ans){
        fie[y][x]=0;
        for(int i=0;i<4;i++){
            func(y+bey[i],x+bex[i]);
        }
    }
    return 0;
}
int main(){
    for(;;){
        cin>>a>>b;
        if(a==0&&b==0)break;
        fill(fie[0],fie[0]+101*101,-1);
        fill(vis[0],vis[0]+101*101,true);
        cin>>sx>>sy>>gx>>gy;
        cin>>n;
        for(int i=0;i<n;i++){
            cin>>col>>muki>>bx>>by;
            if(muki==0){
                for(int i=0;i<=1;i++){
                    for(int j=0;j<=3;j++){
                        fie[by+i][bx+j]=col;
                    }
                }
            }
            if(muki==1){
                for(int i=0;i<=3;i++){
                    for(int j=0;j<=1;j++){
                        fie[by+i][bx+j]=col;
                    }
                }
            }
        }
        ans=fie[sy][sx];
        if(fie[sy][sx]!=0){
            func(sy,sx);
        }
        /*for(int i=1;i<=a;i++){
            for(int j=1;j<=b;j++){
                cout<<fie[i][j];
            }
            cout<<endl;
        }*/
        if(!fie[gy][gx])cout<<"OK"<<endl;
        else cout<<"NG"<<endl;
        cou=0;
        /*for(int i=1;i<=a;i++){
            for(int j=1;j<=b;j++){
                cout<<fie[i][j];
            }
            cout<<endl;
        }*/
    }
return 0;
}
/*6 5
1 1
5 5
3
2 0 1 1
2 0 2 3
2 0 2 5
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: 'vis' was not declared in this scope
   24 |         fill(vis[0],vis[0]+101*101,true);
      |              ^~~
Language: C++

int board[101][101];
int xg , yg;
int w, h;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
int sc;
bool b;

void dfs(int x , int y){
	if(x==xg&&y==yg) {b=true;return;}
	for(int i=0;i<4;++i){
		int tx=x+dx[i];
		int ty=y+dy[i];
		if(tx<=0||ty<=0||tx>w||ty>h) continue;
		if(board[tx][ty]!=sc || board[tx][ty]==0) continue;
		if(b) continue;
		dfs(tx,ty);
	}
}

int main(){
	while(cin >> w >> h , w||h){
		int xs , ys;
		int n;
		b=false;
		memset(board,0,sizeof(board));
		cin >> xs >> ys >> xg >> yg >> n;
		for(int i=0;i<n;++i){
			int c , d , x , y;
			cin >> c >> d >> x >> y;
			if(d==0){
				for(int k=0;k<2;++k){
					for(int j=0;j<4;++j){
						board[x+j][y+k]=c;
					}
				}
			} else if(d==1){
				for(int k=0;k<4;++k){
					for(int j=0;j<2;++j){
						board[x+j][y+k]=c;
					}
				}
			}
		}
		sc=board[xs][ys];
		int gc=board[xg][yg];
		if(sc!=gc) {}
		else dfs(xs,ys);
		cout << ( b ? "OK" : "NG") << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: 'cin' was not declared in this scope
   22 |         while(cin >> w >> h , w||h){
      |               ^~~
a.cc:26:17: error: 'memset' was not declared in this scope
   26 |                 memset(board,0,sizeof(board));
      |                 ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | int board[101][101];
a.cc:49:17: error: 'cout' was not declared in this scope
   49 |                 cout << ( b ? "OK" : "NG") << endl;
      |                 ^~~~
a.cc:49:47: error: 'endl' was not declared in this scope
   49 |                 cout << ( b ? "OK" : "NG") << endl;
      |                                               ^~~~
Language: C++

void Eratosthenes(){
	for(int i = 0; i < N; i++){
		arr[i] = 1;
	}
	for(int i = 2; i < sqrt(N); i++){
		if(arr[i]){
			for(int j = 0; i * (j + 2) < N; j++){
				arr[i *(j + 2)] = 0;
			}
		}
	}

	for(int i = 2; i < N; i++){
		if(arr[i]){
			//cout << i << endl;
		}
	}
}

Compiler output:
a.cc: In function 'void Eratosthenes()':
a.cc:2:28: error: 'N' was not declared in this scope
    2 |         for(int i = 0; i < N; i++){
      |                            ^
a.cc:3:17: error: 'arr' was not declared in this scope
    3 |                 arr[i] = 1;
      |                 ^~~
a.cc:5:33: error: 'N' was not declared in this scope
    5 |         for(int i = 2; i < sqrt(N); i++){
      |                                 ^
a.cc:5:28: error: 'sqrt' was not declared in this scope
    5 |         for(int i = 2; i < sqrt(N); i++){
      |                            ^~~~
a.cc:6:20: error: 'arr' was not declared in this scope
    6 |                 if(arr[i]){
      |                    ^~~
a.cc:13:28: error: 'N' was not declared in this scope
   13 |         for(int i = 2; i < N; i++){
      |                            ^
a.cc:14:20: error: 'arr' was not declared in this scope
   14 |                 if(arr[i]){
      |                    ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
  
// #define int long long
#define pb push_back
  
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
 
template <class X> void print(X Target){ cout << Target << '\n'; }

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

int w, h;
int xs, ys, xg, yg;
int mp[128][128];
bool check[128][128];

void dfs(int y, int x, int color)
{
  if (x < 1 || x > w || y < 1 || y > h) return;
  if (check[y][x]) return;
  check[y][x] = true;
  for (int i = 0; i < 4; i++){
    if (mp[y + dy[i]][x + dx[i]] == color){
      dfs(y + dy[i], x + dx[i], color);
    }
  }
}

signed main()
{
  ios::sync_with_stdio(false);
  int n;

  while (cin >> w >> h, w || h){
    memset(field, false, sizeof(check));
    memset(mp, 0, sizeof(mp));
    cin >> xs >> ys >> xg >> yg >> n;
    for (int i = 0; i < n; i++){
      int c, d, x, y;
      cin >> c >> d >> x >> y;
      if (d){
        for (int j = 0; j < 4; j++){
          for (int k = 0; k < 2; k++){
            mp[y + j][x + k] = c;
          }
        }
      }
      else {
        for (int j = 0; j < 2; j++){
          for (int k = 0; k < 4; k++){
            mp[y + j][x + k] = c;
          }
        }
      }
    }
    dfs(ys, xs, mp[ys][xs]);
    (check[yg][xg]) ? print("OK") : print("NG");
  }

  return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:12: error: 'field' was not declared in this scope
   39 |     memset(field, false, sizeof(check));
      |            ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ANSWER(x) cout<<x<<endl
#define debug(x) cout<<#x<<": "<<x
const int BA = 1000;
const int INFTY = (1<<21);
int xg,yg,w,h,gc;
int maps[101][101];
int solve(int ys,int xs);
int main(){
  int tate[2] = {2,4};
  int yoko[2] = {4,2};
  int xs,ys,n;
  int c[101],d[101],x[101],y[101];
  while(1){
    fill(maps[0],maps[101],0);
    cin >> w >> h;
    if(w==0 && h==0)break;
    cin >> xs >> ys >> xg >> yg >> n;
    for(int i=0;i<n;i++){
      cin >> c[i] >> d[i] >> x[i] >> y[i];
    }
    for(int i=0;i<n;i++){
      for(int j=y[i];j<y[i]+tate[d[i]];j++){
	for(int k=x[i];k<x[i]+yoko[d[i]];k++){
	  if(j == ys && k == xs)gc = c[i];
	  maps[j-1][k-1] = c[i];
	}
      }
    }
    /* for(int i=0;i<h;i++){
       for(int j=0;j<w;j++){
       cout << maps[i][j];
       }
       cout << endl;
       }*///マップ確認用
    if(solve(ys-1,xs-1))cout << "OK\n";
    else cout << "NG\n";
  }
}
int solve(int ys,int xs){
  if(xs < 0 || ys < 0 || xs > w-1 || ys > h-1 || maps[ys][xs] == 0 || map[ys][xs] != gc){
    return 0;
  }
  else if(maps[ys][xs] == maps[yg-1][xg-1]){
    return 1;
  }
  maps[ys][xs] = 0;
  return solve(ys+1,xs) + solve(ys,xs+1)+ solve(ys-1,xs) + solve(ys,xs-1);
}

Compiler output:
a.cc: In function 'int solve(int, int)':
a.cc:42:74: error: missing template arguments before '[' token
   42 |   if(xs < 0 || ys < 0 || xs > w-1 || ys > h-1 || maps[ys][xs] == 0 || map[ys][xs] != gc){
      |                                                                          ^
Language: C++

#include <iostream>
using namespace std;
int F[102][102];

void DFScolor(int X,int Y,int color){

	if(F[X][Y]!=color)
		return;
	
	F[X][Y]=9;
	DFScolor(X-1,Y,color);
	DFScolor(X,Y+1,color);
	DFScolor(X+1,Y,color);
	DFScolor(X,Y-1,color);
	
}


int main(){
while(1){
	int H,W,xg,yg,xs,ys,n,count=0;
	cin>>H;
	if(H==0)
		count++;
	cin>>W;
	if(W==0)
		count++;
	if(count==2)
		return 0;
	cin>>xs>>ys;
	cin>>xg>>yg;	
	cin>>n;
	int c,d,x,y;
	int xb[n],yb[n],colo[n];
	for(int i=0;i<n;i++){
		
		cin>>c>>d>>x>>y;
		colo[i]=c;
		xb[i]=x;
		yb[i]=y;
		if(d==0){
			for(int o=y;o<y+2;o++){
				for(int j=x;j<x+4;j++){
					F[j][o]=c;
				}
			}
		}
		else if(d==1){
			for(int o=y;o<y+4;o++){
				for(int j=x;j<x+2;j++){
					F[j][o]=c;
				}
			}
		}
		
	}
	
	for(int i=0;i<n;i++){
		if(xb[i]==xs&&yb[i]==ys){
			DFScolor(xb[i],yb[i],colo[i],xg,yg);
			
			break;
		}
	}
	if(F[xg][yg]==9)
		cout<<"OK"<<endl;
	else
		cout<<"NG"<<endl;
	
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:33: error: too many arguments to function 'void DFScolor(int, int, int)'
   60 |                         DFScolor(xb[i],yb[i],colo[i],xg,yg);
      |                         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:5:6: note: declared here
    5 | void DFScolor(int X,int Y,int color){
      |      ^~~~~~~~
Language: C++

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

bool isMaze;
int blocks[105][105], xg, yg, w,h;

void dfs(int target, int x, int y){
    if(x < 0 || y < 0 || x >= w || y >= h) return;
    if(x == xg && y == yg){
        isMaze = true;
        return;
    }
    if(blocks[y][x] != target || blocks[y][x] == 0){
        return;
    }

    blocks[y][x] = 9;
    
    dfs(target, x + 1, y);
    dfs(target, x - 1, y);
    dfs(target, x, y + 1);
    dfs(target, x, y - 1);
    return;
}

int main(){
    int xs, ys, n;
    while(cin >> w >> h, w||h){
        rep(i,h) rep(j,w) blocks[i][j] = 0;
        cin >> xs >> ys >> xg >> yg >> n;
        xs--; ys--; xg--; yg--;
        rep(i,n){
            int c, d, x, y;
            cin >> c >> d >> x >> y;
            x--; y--;
            rep(j, (d?4:2)) rep(k, (d?2:4)) b[x + j][y + k] = c;
        }
        isMaze = false;
        dfs(blocks[ys][xs], xs, ys);

        if(isMaze) cout << "OK" << endl;
        else cout << "NG" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:45: error: 'b' was not declared in this scope
   41 |             rep(j, (d?4:2)) rep(k, (d?2:4)) b[x + j][y + k] = c;
      |                                             ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define INF 1010001000
#define loop(i, n) for (int i = 0; i < n; i++)
#define mp make_pair
typedef pair<int, int> i_i;

int sx, sy, gx, gy;
int n, m; 

int main()
{

while(cin >> n >> m,(n|m)){
 m++; n++;
 vector<vector<int> > graph(m,vector<int>(n,0));
 
 cin>>sx>>sy>>gx>>gy;
 int bl;  cin>>bl;
 loop(i, bl){
  int a,b,c,t; cin>>a>>b>>c>>t;
  if(b){
   for(int j=t;j<t+2;j++){
    for(int k=c;k<c+4;k++){
     graph[k][j] = a;
    }
   } 
  } else {
   for(int j=c;j<c+2;j++){
    for(int k=t;k<t+4;k++){
     graph[k][j] = a;
    }
   }
  }
 }
cout<<(dfs(graph))?"OK":"NG"<<endl;
}
return 0;
}

bool dfs(vector<vector<int> > &g) {
int cl = g[sx][sy];
vector<vector<bool> > vsed(m,vector<bool>(n,false));
queue<i_i > q;
q.push(mp(sx,sy));
while(!q.empty()){
int x = q.top().first, y = q.top().second;
q.pop();
if(x == gx && y == gy){
return true;
}
if(vsed[x][y]){
continue;
} else {
vsed[x][y]=true;
}

loop(i, 4) {
int nx = x +dx[i], ny = y +dy[i];
if(0<nx && nx < n && 0<ny && ny < m){
if(g[nx][ny] == cl){
q.push(mp(nx,ny));
}
} 
}

}
return false;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:8: error: 'dfs' was not declared in this scope
   38 | cout<<(dfs(graph))?"OK":"NG"<<endl;
      |        ^~~
a.cc:38:29: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   38 | cout<<(dfs(graph))?"OK":"NG"<<endl;
      |                         ~~~~^~~~~~
a.cc: In function 'bool dfs(std::vector<std::vector<int> >&)':
a.cc:46:1: error: 'queue' was not declared in this scope
   46 | queue<i_i > q;
      | ^~~~~
a.cc:4:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    3 | #include <algorithm>
  +++ |+#include <queue>
    4 | using namespace std;
a.cc:46:11: error: expected primary-expression before '>' token
   46 | queue<i_i > q;
      |           ^
a.cc:46:13: error: 'q' was not declared in this scope
   46 | queue<i_i > q;
      |             ^
a.cc:51:15: error: 'y' was not declared in this scope
   51 | if(x == gx && y == gy){
      |               ^
a.cc:54:12: error: 'y' was not declared in this scope
   54 | if(vsed[x][y]){
      |            ^
a.cc:61:13: error: 'dx' was not declared in this scope; did you mean 'nx'?
   61 | int nx = x +dx[i], ny = y +dy[i];
      |             ^~
      |             nx
a.cc:62:24: error: 'ny' was not declared in this scope; did you mean 'nx'?
   62 | if(0<nx && nx < n && 0<ny && ny < m){
      |                        ^~
      |                        nx
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
#define INF 1010001000
#define loop(i, n) for (int i = 0; i < n; i++)
#define mp make_pair
typedef pair<int, int> i_i;

bool dfs(vector<vector<int> > &g);

int sx, sy, gx, gy;
int n, m; 
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};

int main()
{

while(cin >> n >> m,(n|m)){
 m++; n++;
 vector<vector<int> > graph(m,vector<int>(n,0));
 
 cin>>sx>>sy>>gx>>gy;
 int bl;  cin>>bl;
 loop(i, bl){
  int a,b,c,t; cin>>a>>b>>c>>t;
  if(b){
   for(int j=t;j<t+2;j++){
    for(int k=c;k<c+4;k++){
     graph[k][j] = a;
    }
   } 
  } else {
   for(int j=c;j<c+2;j++){
    for(int k=t;k<t+4;k++){
     graph[k][j] = a;
    }
   }
  }
 }
cout << (dfs(graph)) ? "OK" : "NG" << endl;
}
return 0;
}

bool dfs(vector<vector<int> > &g) {
int cl = g[sx][sy];
vector<vector<bool> > vsed(m,vector<bool>(n,false));
queue<i_i > q;
q.push(mp(sx,sy));
while(!q.empty()){
int x = q.top().first, y = q.top().second;
q.pop();
if(x == gx && y == gy){
return true;
}
if(vsed[x][y]){
continue;
} else {
vsed[x][y]=true;
}

loop(i, 4) {
int nx = x +dx[i], ny = y +dy[i];
if(0<nx && nx < n && 0<ny && ny < m){
if(g[nx][ny] == cl){
q.push(mp(nx,ny));
}
} 
}

}
return false;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:36: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   43 | cout << (dfs(graph)) ? "OK" : "NG" << endl;
      |                               ~~~~~^~~~~~~
a.cc: In function 'bool dfs(std::vector<std::vector<int> >&)':
a.cc:54:11: error: 'class std::queue<std::pair<int, int> >' has no member named 'top'; did you mean 'pop'?
   54 | int x = q.top().first, y = q.top().second;
      |           ^~~
      |           pop
a.cc:56:15: error: 'y' was not declared in this scope
   56 | if(x == gx && y == gy){
      |               ^
a.cc:59:12: error: 'y' was not declared in this scope
   59 | if(vsed[x][y]){
      |            ^
a.cc:66:25: error: 'y' was not declared in this scope; did you mean 'ny'?
   66 | int nx = x +dx[i], ny = y +dy[i];
      |                         ^
      |                         ny
Language: C++

#include<cstdio>
#include<cstring>
#include<stack>
struct p{
	int x;
	int y;
};
using namespace std;
int main(){
	int w,h,sx,sy,gx,gy,n,c,d,x,y,i,j,k,o;
	int map[100][100];
	int used[100][100];
	int mx[4]={-1,0,1,0};
	int my[4]={0,-1,0,1};
	p v,u;
	stack<p> s;
	while(1){
		scanf("%d %d",&w,&h);
		if(w==0&&h==0){
			break;
		}
		memset(map,0,sizeof(map));
		memset(used,0,sizeof(used));
		scanf("%d %d",&sx,&sy);
		sx--;
		sy--;
		scanf("%d %d",&gx,&gy);
		gx--;
		gy--;
		scanf("%d",&n);
		for(i=0;i<n;i++){
			scanf("%d %d %d %d",&c,&d,&x,&y);
			x--;
			y--;
			if(!d){
				for(j=y;j<y+2;j++){
					for(k=x;k<x+4;k++){
						map[j][k]=c;
					}
				}
			}
			else{
				for(j=y;j<y+4;j++){
					for(k=x;k<x+2;k++){
						map[j][k]=c;
					}
				}
			}
		}
		if(map[sy][sx]!=map[gy][gx]){
			printf("NG\n");
			continue;
		}
		v.x=sx;
		v.y=sy;
		s.push(v);
		o=0;
		while(!s.empty()){
			v=s.top();
			s.pop();
			if(used[v.y][v.x]){
				continue;
			}
			else{
				used[v.y][v.x]=1;
			}
			if(v.x==gx&&v.y==gy){
				o=1;
				while(!s.empty){
					s.pop();
				}
				break;
			}
			for(i=0;i<4;i++){
				u=v;
				u.x+=mx[i];
				u.y+=my[i];
				if(u.x>=0&&u.x<w&&u.y>=0&&u.y<h&&map[u.y][u.x]==map[sy][sx]){
					s.push(u);
				}
			}
		}
		if(o){
			printf("OK\n");
		}
		else{
			printf("NG\n");
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:42: error: cannot convert 'std::stack<p>::empty' from type 'bool (std::stack<p>::)() const' to type 'bool'
   69 |                                 while(!s.empty){
      |                                          ^~~~~
a.cc:69:42: error: in argument to unary !
   69 |                                 while(!s.empty){
      |                                        ~~^~~~~
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define rep2(i, n) for(int i = 1; i <= n; ++i)
#define INF 0
#define MAX 102

using namespace std;

const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
 
int field[102][102];
int h, w, sx, sy, gx, gy, n;
int col, dire, x, y;
int scol;

bool dfs(int nx, int ny) {
	if(nx == gx && ny == gy) return true;
	field[nx][ny] = -1;
	for(int i = 0; i < 4; ++i) {
		int nex = nx + dx[i];
		int ney = ny + dy[i];
		if(0 < nex && nex <= w && 0 < ney && ney <= h && scol == field[nex][ney]) {
			if(dfs(nex, ney)) return true;
		}
	}
	return false;
}

int main() {
	while(1) {
		scol = INF;
		cin >> h >> w;
		for(int i = 1; i <= h; ++i) {
			for(int j = 1; j <= w; ++j) {
				field[i][j] = 0;
			}
		}
		if(h == 0 && w == 0) break;
		cin >> sx >> sy >> gx >> gy;
		cin >> n;
		rep(k, n) {
			cin >> col >> dire >> x >> y;
			if(dire == 1) {
				for(int i = 0; i < 4; ++i) {
					for(int j = 0; j < 2; ++j) field[x+j][y+i] = col;
				}a
			}
			else {
				for(int i = 0; i < 2; ++i) {
					for(int j = 0; j < 4; ++j) field[x+j][y+i] = col;
				}
			}
		}
		scol = field[sx][sy];
		if(dfs(sx, sy)) cout << "OK" << endl;
		else cout << "NG" << endl; 
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:34: error: 'a' was not declared in this scope
   48 |                                 }a
      |                                  ^
Language: C++

#include<iostream>
using namespace std;

int Array[200][200];
#define START 20

void DFS(int h,int w,int c){


    if(Array[h][w] == GOAL){
      is_goal = true;
      return;
    }

    if(Array[h][w] != c || Array[h][w] == 0 || Array[h][w] == 6){
      return;
    }

    int tmp=Array[h][w];

    Array[h][w] = 6;

    DFS(h-1,w,tmp);
    DFS(h,w+1,tmp);
    DFS(h+1,w,tmp);
    DFS(h,w-1,tmp);


}

int main(){

    while(1){
      int H,W;
      int Start[2],Goal[2];
      int BlockNum;
      int color,dir,xpos,ypos;


      for(int i=0;i<200;i++){
        for(int j=0;j<200;j++){
          Array[i][j] = 0;
        }
      }

      cin >> H >> W;

      if(H == 0 && W == 0){
        break;
      }

      cin >> Start[0] >> Start[1];

      cin >> Goal[0] >> Goal[1];

      cin >> BlockNum;

      for(int i=0;i<BlockNum;i++){
        cin >> color >> dir >> xpos >> ypos;
        for(int i=0;i<4;i++){
          for(int j=0;j<2;j++){
            if(!dir){//?¨?
              Array[xpos+i][ypos+j] = color;
            }
            else{
              Array[xpos+j][ypos+i] = color;
            }
          }
        }
      }
      
      /*for(int i=1;i<=H;i++){
        for(int j=1;j<=W;j++){
          cout << Array[i][j];
        }
        cout << endl;
      }*/
      if(Array[Start[0]][Start[1]] != 0){
        DFS(Start[0],Start[1],Array[Start[0]][Start[1]]);
      }
      if(Array[Goal[0]][Goal[1]] == 6){
        cout << "OK" << endl;
      }
      else{
        cout << "NG" << endl;
      }

  }
    return 0;
}

Compiler output:
a.cc: In function 'void DFS(int, int, int)':
a.cc:10:23: error: 'GOAL' was not declared in this scope
   10 |     if(Array[h][w] == GOAL){
      |                       ^~~~
a.cc:11:7: error: 'is_goal' was not declared in this scope
   11 |       is_goal = true;
      |       ^~~~~~~
Language: C++

#include<iostream>
using namespace std;

char F[102][102];

void DFS(int Y,int X,char C){
	if(F[Y][X]!=C)
		return;

	F[Y][X]='.';
	
	DFS(Y-1,X,C);
	DFS(Y,X+1,C);	
	DFS(Y+1,X,C);
	DFS(Y,X-1,C);

}


int main(){
while(1){
	int w,h;
	cin>>w>>h;
	if(w==0&&h==0)
		break;
	
	int xs,ys,xg,yg;
	cin>>xs>>ys>>xg>>yg;
	int n;
	cin>>
#include<iostream>
using namespace std;

char F[102][102];

void DFS(int Y,int X,char C){
	if(F[Y][X]!=C)
		return;

	F[Y][X]='.';
	
	DFS(Y-1,X,C);
	DFS(Y,X+1,C);	
	DFS(Y+1,X,C);
	DFS(Y,X-1,C);

}


int main(){
while(1){
	int w,h;
	cin>>w>>h;
	if(w==0&&h==0)
		break;
	
	int xs,ys,xg,yg;
	cin>>xs>>ys>>xg>>yg;
	int n;
	cin>>n;
	char C;
	for(int i=0;i<n;i++){
		int d,x,y;
		char c;
		cin>>c;
		cin>>d>>x>>y;
		if(d==0){
			for(int j=0;j<2;j++){
				for(int l=0;l<4;l++){
					F[y+j][x+l]=c;
				}
			}
		}else{
			for(int j=0;j<4;j++){
				for(int l=0;l<2;l++){
					F[y+j][x+l]=c;
				}
			}
		}
	}
	C=F[ys][xs];
	if(C!=0){
		DFS(ys,xs,C);
		if(F[yg][xg]=='.'&&F[ys][xs]=='.'){
			cout<<"OK"<<endl;
		}else{
			cout<<"NG"<<endl;
		}
	}else{
		cout<<"NG"<<endl;
	}
	
	
}
return 0;
}n;
	char C;
	for(int i=0;i<n;i++){
		int d,x,y;
		char c;
		cin>>c;
		cin>>d>>x>>y;
		if(d==0){
			for(int j=0;j<2;j++){
				for(int l=0;l<4;l++){
					F[y+j][x+l]=c;
				}
			}
		}else{
			for(int j=0;j<4;j++){
				for(int l=0;l<2;l++){
					F[y+j][x+l]=c;
				}
			}
		}
	}
	C=F[ys][xs];
	if(C!=0){
		DFS(ys,xs,C);
		if(F[yg][xg]=='.'&&F[ys][xs]=='.'){
			cout<<"OK"<<endl;
		}else{
			cout<<"NG"<<endl;
		}
	}else{
		cout<<"NG"<<endl;
	}
	
	
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:1: error: expected primary-expression before 'using'
   32 | using namespace std;
      | ^~~~~
a.cc:36:29: error: a function-definition is not allowed here before '{' token
   36 | void DFS(int Y,int X,char C){
      |                             ^
a.cc:50:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   50 | int main(){
      |         ^~
a.cc:50:9: note: remove parentheses to default-initialize a variable
   50 | int main(){
      |         ^~
      |         --
a.cc:50:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:50:11: error: a function-definition is not allowed here before '{' token
   50 | int main(){
      |           ^
Language: C++

#include "stdafx.h"
#include <iostream>
using namespace std;

int F[102][102];

void DFS(int Y, int X, int c) {
	//cout << Y << " " << X << endl;
	if (F[Y][X] != c || c != 0)
		return;
	F[Y][X] = 10;
	DFS(Y - 1, X, c);//???
					 //DFS(Y - 1, X+1, A_ito);//??????
	DFS(Y, X + 1, c);//???
					 //DFS(Y + 1, X+1, A_ito);//??????
	DFS(Y + 1, X, c);//???
					 //DFS(Y + 1, X-1, A_ito);//??????
	DFS(Y, X - 1, c);//???
					 //DFS(Y - 1, X-1, A_ito);//??????
}


int main()
{
	int xs, ys, xg, yg, n;
	int c, d, x, y;
	int W = 1, H = 1;

	while ((W != 0) && (H != 0)) {
		cin >> W >> H;
		cin >> xs >> ys >> xg >> yg >> n;
		for (int i = 1;i <= n;i++) {
			cin >> c >> d >> x >> y;
			if (d == 0) {
				F[x][y] = c;
				F[x][y + 1] = c;
				F[x + 1][y] = c;
				F[x + 1][y + 1] = c;
				F[x + 2][y] = c;
				F[x + 2][y + 1] = c;
				F[x + 3][y] = c;
				F[x + 3][y + 1] = c;
			}
			if (d == 1) {
				F[x][y] = c;
				F[x + 1][y] = c;
				F[x][y + 1] = c;
				F[x + 1][y + 1] = c;
				F[x][y + 2] = c;
				F[x + 1][y + 2] = c;
				F[x][y + 3] = c;
				F[x + 1][y + 3] = c;
			}
		}
		if (F[ys][xs] != 0)
			DFS(ys, xs, F[ys][xs]);

		if (F[yg][xg] == 10) {
			cout << "OK" << endl;
		}
		else { cout << "NG" << endl; }
		/*for (int i = 0;i < H;i++) {
			for (int j = 0;j < W;j++) {
				F[i][j] = 0;
			}
		}
		*/
	}

	return 0;
}

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

#include "stdafx.h"
#include <iostream>
using namespace std;

int F[102][102] = { 0 };

void DFS(int Y, int X, int c) {
	//cout << Y << " " << X << endl;
	if (F[Y][X] != c)
		return;
	F[Y][X] = 10;
	DFS(Y - 1, X, c);//???
					 //DFS(Y - 1, X+1, A_ito);//??????
	DFS(Y, X + 1, c);//???
					 //DFS(Y + 1, X+1, A_ito);//??????
	DFS(Y + 1, X, c);//???
					 //DFS(Y + 1, X-1, A_ito);//??????
	DFS(Y, X - 1, c);//???
					 //DFS(Y - 1, X-1, A_ito);//??????
}


int main()
{
	int xs, ys, xg, yg, n;
	int c, d, x, y;
	int W = 1, H = 1;

	while ((W != 0) && (H != 0)) {
		cin >> W >> H;
		for (int i = 1;i <= H;i++) {
			for (int j = 1;j <= W;j++) {
				F[i][j] = 6;
			}
		}
		cin >> xs >> ys >> xg >> yg >> n;
		for (int i = 1;i <= n;i++) {
			cin >> c >> d >> x >> y;
			if (d == 0) {
				F[x][y] = c;
				F[x][y + 1] = c;
				F[x + 1][y] = c;
				F[x + 1][y + 1] = c;
				F[x + 2][y] = c;
				F[x + 2][y + 1] = c;
				F[x + 3][y] = c;
				F[x + 3][y + 1] = c;
			}
			if (d == 1) {
				F[x][y] = c;
				F[x + 1][y] = c;
				F[x][y + 1] = c;
				F[x + 1][y + 1] = c;
				F[x][y + 2] = c;
				F[x + 1][y + 2] = c;
				F[x][y + 3] = c;
				F[x + 1][y + 3] = c;
			}
		}
		if(F[ys][xs]!=0)
			DFS(ys, xs, F[ys][xs]);

		if (F[yg][xg] == F[ys][yg]) {
			cout << "OK" << endl;
		}
		else { cout << "NG" << endl; }
		for (int i = 0;i <= H;i++) {
			for (int j = 0;j <= W;j++) {
				F[i][j] = 0;
			}
		}
		
	}

	return 0;
}

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

#include<iostream>
using namespace std;

int F[102][102];

void DFS(int Y,int X,int C){
   if(F[Y][X]!=C)
      return;
   F[Y][X]=6;
   DFS(Y-1,X,C);
   DFS(Y,X+1,C);
   DFS(Y+1,X,C);
   DFS(Y,X-1,C);
} 

int main(){
   int w,h,xs,ys,xg,yg,n;
   int c,d,x,y;
   while(true){
      cin >> w >> h;
      if(w==0&&h==0)
         break;
      cin >> xs >> ys;
      cin >> xg >> yg;
      cin >> n;
      for(int i=1;i<=n;i++){
         cin >> c >> d >> x >> y;
         if(d==0){
             F[x+1][y+1]=c;
             F[x+2][y+1]=c;
             F[x+3][y+1]=c;
             F[x+4][y+1]=c;  
             F[x+1][y+2]=c;
             F[x+2][y+2]=c;
             F[x+3][y+2]=c;
             F[x+4][y+2]=c;   
         }
         if(d==1){
             F[x+1][y+1]=c;
             F[x+1][y+2]=c;
             F[x+1][y+3]=c;
             F[x+1][y+4]=c;  
             F[x+2][y+1]=c;
             F[x+2][y+2]=c;
             F[x+2][y+3]=c;
             F[x+2][y+4]=c;   
         }
      }
      if(F[xs][xy]!=1&&F[xs][xy]!=2&&F[xs][xy]!=3&&F[xs][xy]!=4&&F[xs][xy]!=5)
         cout << "NG" << endl;
      else{
         DFS(xs+1,ys+1,c);
         if(F[xg+1][yg+1]==6)
            cout << "OK" << endl;
         else
            cout << "NG" << endl;
         for(int i=1;i<=w;i++)
            for(int j=1;j<=h;j++)
               F[i][j]=0;
      }
   }
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:16: error: 'xy' was not declared in this scope; did you mean 'y'?
   49 |       if(F[xs][xy]!=1&&F[xs][xy]!=2&&F[xs][xy]!=3&&F[xs][xy]!=4&&F[xs][xy]!=5)
      |                ^~
      |                y
Language: C++

#include<functional>
#include<algorithm>
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,x,n) for(int i=x;i<n;i++)
#define all(v) (v).begin(),(v).end()
#define pf push_front
#define pb push_back
#define int long long
using namespace std;
const int INF=1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int mp[100001][100001];
bool ans;
int w,h,tmp;
int xs,ys,xg,yg;

void dfs(int y,int x,int c){
  if(y>0&&y<=h&&x>0&&x<=w&&mp[y][x]==c){
    mp[y][x]=0;
    rep(i,4){
      dfs(y+dy[i],x+dx[i],c);
    }
  }else return;
  if(y==yg&&x==xg){
    ans=true;
    return;
  }
}

signed main(){
  while(cin>>w>>h,w){
    rep(i,w)rep(j,h)mp[i][j]==0;
    ans=false;
    cin>>xs>>ys>>xg>>yg;
    //xs--;ys--;xg--;yg--;
    int n;
    cin>>n;
    rep(i,n){
      int c,d,x,y;
      cin>>c>>d>>x>>y;
      //x--;y--;
      if(d==0)rep(i,2)rep(j,4)mp[y+i][x+j]=c;
      else rep(i,2)rep(j,4)mp[y+j][x+i]=c;
    }
    tmp=mp[ys][xs];
    if(mp[ys][xs]==tmp&&mp[yg][xg]==tmp)dfs(ys,xs,tmp);
    cout<<(ans?"OK":"NG")<<endl;
  }

return 0;
}

Compiler output:
/tmp/ccCsALhd.o: in function `dfs(long long, long long, long long)':
a.cc:(.text+0x22): relocation truncated to fit: R_X86_64_PC32 against symbol `h' defined in .bss section in /tmp/ccCsALhd.o
a.cc:(.text+0x3e): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccCsALhd.o
a.cc:(.text+0x10b): relocation truncated to fit: R_X86_64_PC32 against symbol `yg' defined in .bss section in /tmp/ccCsALhd.o
a.cc:(.text+0x118): relocation truncated to fit: R_X86_64_PC32 against symbol `xg' defined in .bss section in /tmp/ccCsALhd.o
a.cc:(.text+0x124): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccCsALhd.o
/tmp/ccCsALhd.o: in function `main':
a.cc:(.text+0x157): relocation truncated to fit: R_X86_64_PC32 against symbol `h' defined in .bss section in /tmp/ccCsALhd.o
a.cc:(.text+0x169): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccCsALhd.o
a.cc:(.text+0x175): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccCsALhd.o
a.cc:(.text+0x17d): relocation truncated to fit: R_X86_64_PC32 against symbol `xs' defined in .bss section in /tmp/ccCsALhd.o
a.cc:(.text+0x199): relocation truncated to fit: R_X86_64_PC32 against symbol `ys' defined in .bss section in /tmp/ccCsALhd.o
a.cc:(.text+0x1ae): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

int F[102][102];
int xg,yg;
int flag = 0;

void DFS(int Y,int X,int c){
  if(F[Y][X]!=c){
    return 0;
  }
  if(Y == xg && X == yg){
    flag = 1;
  }

  F[Y][X] = 0;
  DFS(Y-1,X  ,c);
  //DFS(Y-1,X+1,c);
  DFS(Y  ,X+1,c);
  //DFS(Y+1,X+1,c);
  DFS(Y+1,X  ,c);
  //DFS(Y+1,X-1,c);
  DFS(Y  ,X-1,c);
  //DFS(Y-1,X-1,c);
}


int main(){
  int w,h,xs,ys,n;
  cin >> w >> h >> xs >> ys >> xg >> yg >> n;
  for(int i=0;i<n;i++){
    int c,d,x,y;
    cin >> c >> d >> x >> y;
    if(d == 0){
      for(int j=0;j<4;j++){
        F[x+j][y] = c;
        F[x+j][y+1] = c;
      }
    } else {
      for(int j=0;j<4;j++){
        F[x][y+j] = c;
        F[x+1][y+j] = c;
      }
    }
  }

  DFS(xs,ys,F[xs][ys]);
  if(flag == 1){
    cout << "OK" << endl;
  } else {
    cout << "NG" <<endl;
  }

}



Compiler output:
a.cc: In function 'void DFS(int, int, int)':
a.cc:10:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   10 |     return 0;
      |            ^
Language: C++

#include <iostream>
using namespace std;

int F[102][102];
int xg,yg;
int flag = 0;

void DFS(int Y,int X,int c){
  if(F[Y][X]!=c){
    return;
  }
  if(Y == xg && X == yg){
    flag = 1;
  }

  F[Y][X] = 0;
  DFS(Y-1,X  ,c);
  //DFS(Y-1,X+1,c);
  DFS(Y  ,X+1,c);
  //DFS(Y+1,X+1,c);
  DFS(Y+1,X  ,c);
  //DFS(Y+1,X-1,c);
  DFS(Y  ,X-1,c);
  //DFS(Y-1,X-1,c);
}


int main(){
  int w,h,xs,ys,n;
  cin >> w >> h >> xs >> ys >> xg >> yg >> n;
  for(int i=0;i<n;i++){
    int c,d,x,y;
    cin >> c >> d >> x >> y;
    if(d == 0){
      for(int j=0;j<4;j++){
        F[x+j][y] = c;
        F[x+j][y+1] = c;
      }
    } else {#include <iostream>
using namespace std;

int F[102][102];
int xg,yg;
int flag = 0;

void DFS(int Y,int X,int c){
  if(F[Y][X]!=c){
    return 0;
  }
  if(Y == xg && X == yg){
    flag = 1;
  }

  F[Y][X] = 0;
  DFS(Y-1,X  ,c);
  //DFS(Y-1,X+1,c);
  DFS(Y  ,X+1,c);
  //DFS(Y+1,X+1,c);
  DFS(Y+1,X  ,c);
  //DFS(Y+1,X-1,c);
  DFS(Y  ,X-1,c);
  //DFS(Y-1,X-1,c);
}


int main(){
  int w,h,xs,ys,n;
  cin >> w >> h >> xs >> ys >> xg >> yg >> n;
  for(int i=0;i<n;i++){
    int c,d,x,y;
    cin >> c >> d >> x >> y;
    if(d == 0){
      for(int j=0;j<4;j++){
        F[x+j][y] = c;
        F[x+j][y+1] = c;
      }
    } else {
      for(int j=0;j<4;j++){
        F[x][y+j] = c;
        F[x+1][y+j] = c;
      }
    }
  }

  DFS(xs,ys,F[xs][ys]);
  if(flag == 1){
    cout << "OK" << endl;
  } else {
    cout << "NG" <<endl;
  }

}

      for(int j=0;j<4;j++){
        F[x][y+j] = c;
        F[x+1][y+j] = c;
      }
    }
  }

  DFS(xs,ys,F[xs][ys]);
  if(flag == 1){
    cout << "OK" << endl;
  } else {
    cout << "NG" <<endl;
  }

}



Compiler output:
a.cc:39:13: error: stray '#' in program
   39 |     } else {#include <iostream>
      |             ^
a.cc: In function 'int main()':
a.cc:39:14: error: 'include' was not declared in this scope
   39 |     } else {#include <iostream>
      |              ^~~~~~~
a.cc:39:31: error: expected primary-expression before '>' token
   39 |     } else {#include <iostream>
      |                               ^
a.cc:40:1: error: expected primary-expression before 'using'
   40 | using namespace std;
      | ^~~~~
a.cc:46:28: error: a function-definition is not allowed here before '{' token
   46 | void DFS(int Y,int X,int c){
      |                            ^
a.cc:66:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   66 | int main(){
      |         ^~
a.cc:66:9: note: remove parentheses to default-initialize a variable
   66 | int main(){
      |         ^~
      |         --
a.cc:66:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:66:11: error: a function-definition is not allowed here before '{' token
   66 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int F[102][102];

bool DFS(int Y, int X, int C, int yg, int xg)
{
  if(Y == yg && X == xg)
    return true;
  if(F[Y][X]!=C)
    return false;

  F[Y][X] = 0;

  bool tmp = 0;
  tmp += DFS(Y-1, X, C, yg, xg);
  tmp += DFS(Y+1, X, C, yg, xg);
  tmp += DFS(Y, X-1, C, yg, xg);
  tmp += DFS(Y, X+1, C, yg, xg);
  return tmp;
}

int main()
{
  while(1){
    F[102][102] = {}

    int w, h;
    cin >> w >> h;

    if(w == 0 && h == 0)
      return 0;

    int xs, ys;
    cin >> xs >> ys;

    int xg, yg;
    cin >> xg >> yg;

    int n;
    cin >> n;

    int c, d, x, y;
    for(int i=0; i<n; i++){
      cin >> c >> d >> x >> y;
      if(d == 0)
        for(int j=0; j<2; j++)
          for(int k=0; k<4; k++)
            F[y+j][x+k] = c;
      else
        for(int j=0; j<4; j++)
          for(int k=0; k<2; k++)
            F[y+j][x+k] = c;
    }

    bool res = DFS(ys, xs, F[ys][xs], yg, xg);

    if(res)
      cout << "OK" << endl;
    else
      cout << "NG" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:21: error: expected ';' before 'int'
   26 |     F[102][102] = {}
      |                     ^
      |                     ;
   27 | 
   28 |     int w, h;
      |     ~~~              
a.cc:29:12: error: 'w' was not declared in this scope
   29 |     cin >> w >> h;
      |            ^
a.cc:29:17: error: 'h' was not declared in this scope
   29 |     cin >> w >> h;
      |                 ^
Language: C++

#include <iostream>
using namespace std;

int F[105][105];
int xg,yg;


void DFS(int Y,int X,int c){
  if(F[Y][X] != c){
    return;
  }

  F[Y][X] = -1;
  DFS(Y-1,X  ,c);
  DFS(Y  ,X+1,c);
  DFS(Y+1,X  ,c);
  DFS(Y  ,X-1,c);
}


int main(){
  int w,h,xs,ys,n;
  while(1){
    cin >> w >> h;
    if(w == 0 && h == 0)
      break;

      for(int i=0;i<105;i++){
        for(int j=0;j<105;j++){
                F[i][j]=0
        }
      }
    cin >> xs >> ys >> xg >> yg >> n;


    for(int i=0;i<n;i++){
      int c,d,x,y;
      cin >> c >> d >> x >> y;
      if(d == 0){
        for(int j=0;j<4;j++){
          F[x+j][y] = c;
          F[x+j][y+1] = c;
        }
      } else {
        for(int j=0;j<4;j++){
          F[x][y+j] = c;
          F[x+1][y+j] = c;
        }
      }
    }

  DFS(xs,ys,F[xs][ys]);
  if(F[xg][yg] == -1){
    cout << "OK" << endl;
  } else {
    cout << "NG" <<endl;
  }
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:30:26: error: expected ';' before '}' token
   30 |                 F[i][j]=0
      |                          ^
      |                          ;
   31 |         }
      |         ~
Language: C++

#include <iostream>
using namespace std;

int F[105][105];


void DFS(int Y,int X,int c){
  if(F[Y][X] != c){
    return;
  }

  F[Y][X] = -1;
  DFS(Y-1,X  ,c);
  DFS(Y  ,X+1,c);
  DFS(Y+1,X  ,c);
  DFS(Y  ,X-1,c);
}


int main(){
  int w,h,xs,ys,xgyg,n;
  while(1){
    cin >> w >> h;
    if(w == 0 && h == 0)
      break;

      for(int i=0;i<105;i++){
        for(int j=0;j<105;j++){
                F[i][j]=0;
        }
      }
    cin >> xs >> ys >> xg >> yg >> n;


    for(int i=0;i<n;i++){
      int c,d,x,y;
      cin >> c >> d >> x >> y;
      if(d == 0){
        for(int j=0;j<4;j++){
          F[x+j][y] = c;
          F[x+j][y+1] = c;
        }
      } else {
        for(int j=0;j<4;j++){
          F[x][y+j] = c;
          F[x+1][y+j] = c;
        }
      }
    }

  DFS(xs,ys,F[xs][ys]);
  if(F[xg][yg] == -1){
    cout << "OK" << endl;
  } else {
    cout << "NG" <<endl;
  }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:24: error: 'xg' was not declared in this scope; did you mean 'xs'?
   32 |     cin >> xs >> ys >> xg >> yg >> n;
      |                        ^~
      |                        xs
a.cc:32:30: error: 'yg' was not declared in this scope; did you mean 'ys'?
   32 |     cin >> xs >> ys >> xg >> yg >> n;
      |                              ^~
      |                              ys