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

#include<iostream>
#include <algorithm>
using namespace std;
#define MAX_LIST 10000000



int main(){
	//bool *prime=(bool *)malloc(sizeof(bool)*MAX_LIST);
	bool prime[MAX_LIST];
	for(int i=0;i<MAX_LIST;i++){
		prime[i]=1;
	}
	prime[0]=prime[1]=0;
	for(int i=0;i*i<MAX_LIST;i++){
		if(prime[i]==1){ 
			for(int j=i*2;j<MAX_LIST;j=j+i){
				prime[j]=0;
			}
		}
	}
	//int *primelist=(int *)malloc(sizeof(int)*MAX_LIST);
	/*
	int primelist[MAX_LIST];
	int j=0;
	for(int i=0;i<MAX_LIST;i++){
		if(prime[i]==1){
			primelist[j]=i;
			j++;
			}
		}
	}*/
	//int *prime_num=(int*)malloc(sizeof(int)*MAX_LIST);
	/*
	int prime_num[MAX_LIST];
	prime_num[0]=1;
	for(int i=1;i<MAX_LIST;i++){
		prime_num[i]=prime_num[i-1]+prime[i];
	}*/
	/*
	int n;
	while(cin>>n,n){
		int ans=0;
		int s;
		int num=MAX_LIST-1;
		for(int i=num;i>0;i--){
			if(primelist[i]>n){
			}else{
				if((primelist[i]-primelist[i-1]==2)
					&&(primelist[i-2]-primelist[i-3]==2)
					&&(primelist[i-1]-primelist[i-2]==4)){
						ans=primelist[i];
						break;
				}
			}
		}
		
		cout<<ans<<endl;
	}/*
	return 0;
}

Compiler output:
a.cc:40:9: error: unterminated comment
   40 |         /*
      |         ^
a.cc: In function 'int main()':
a.cc:21:10: error: expected '}' at end of input
   21 |         }
      |          ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

//テ・ツ崢崚」ツ?、テ・ツュツ静ァツエツ?ヲツ閉ーテ」ツ?ョテ・ツ、ツァテ」ツ?催」ツ?陛」ツつ津ゥツ?催・ツ按療」ツ?ォテ・ツ?・テ」ツつ古」ツ?淌」ツつ欝ime Limit Exceededテ」ツ?ァテ」ツ?療」ツ??
//テァツ崢エテ」ツ?療」ツ?ヲテ」ツつづァツ崢エテ」ツ?療」ツ?ヲテ」ツつ５ime Limit Exceeded___テ」ツδ嘉」ツδ?」ツδ愿」ツ?ァテ」ツ??
//テ」ツつィテ」ツδゥテ」ツつケテ」ツδ暗」ツδ?」ツδ催」ツつケテ」ツ?ョテァツッツゥテ」ツつ津」ツ?凖」ツ?」テ」ツ?凝」ツつ甘・ツソツ佚」ツつ古」ツ?ヲテ」ツ??」ツ?セテ」ツ?療」ツ?淌」ツ??
// Respect2Dテ」ツ?陛」ツつ禿」ツ?ョテ」ツつウテ」ツδ。テ」ツδウテ」ツδ暗」ツつ津ィツヲツ凝」ツ?ヲテヲツーツ療」ツ?古」ツ?、テ」ツ?催」ツ?セテ」ツ?療」ツ?淌」ツ??

import java.util.*;
public class Main{
    static Scanner kbd = new Scanner(System.in);

    static int[] prime = new int[10000001];
    // 0:テヲツ慊ェテ・ツ按、テ・ツョツ?
    // 1:テァツエツ?ヲツ閉ー
    // -1:テァツエツ?ヲツ閉ーテ」ツ?ァテ」ツ?ッテ」ツ?ェテ」ツ??

    public static void main(String[] args){

	prepare();

	while(true){
	    int n = kbd.nextInt();
	    if(n==0) break;
	    solve(n);
	}
    }

    static void prepare(){
	prime[0] = prime[1] = -1;
	int i=2;
	for(; i<prime.length; i++){
	    if(prime[i] == 0){
		prime[i] = 1;
		for(int j=i+i; j<prime.length; j+=i) prime[j]=-1;
	    }
	}
    }

    static void solve(int n){

	while(!(prime[n]==1 && prime[n-2]==1 && prime[n-6]==1 && prime[n-8]==1)){
	    n--;
	}
	System.out.println(n);
    }

    /*
    static boolean prime(int a){
	int k = (int)Math.sqrt(a);
	for(int l=2; l<=k; l++){
	    if(a%l == 0) return false;
	}
	return true;
    }
    */
}

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

#include <iostream>
#include <cmath>
using namespace std;
bool flag[10000001];

int main(){
    int n;
    for(int i=0;i <= 1000000;i++){
        if(i<=1)flag[i]=false;
        else flag[i]=true;
    }
    for(int i=2;i <= 1001 ;i++){
        if(flag[i]==true){
            for(int j=i*2 ; j<=1000000 ; j=j+i){
                flag[j] = false;
            }
        }
    }
    while(cin>>n,n){
        forint i=n;i!=0;i--){
                cout<<"*"<<i<<endl;
            if(flag[i]&&flag[i-2]&&flag[i-6]&&flag[i-8]){
                cout<<i<<endl;
                break;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'forint' was not declared in this scope; did you mean 'rint'?
   20 |         forint i=n;i!=0;i--){
      |         ^~~~~~
      |         rint
a.cc:20:20: error: 'i' was not declared in this scope
   20 |         forint i=n;i!=0;i--){
      |                    ^
Language: C++

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


#define MAX_N 10000000
int prime[MAX_N];
bool is_prime[MAX_N+1];
int sieve(int n){
	int p=0;
	memset(is_prime,true,sizeof(is_prime));
	is_prime[0]=is_prime[1]=false;
	for(int i=2;i<=n;i++){
		if(is_prime[i]){
			prime[p++]=i;
			for(int j=2*i;j<=n;j+=i)is_prime[j]=false;
		}
	}
	return p;
}


int main(){
	int n;
	sieve(MAX_N);
	while(cin>>n,n){
		int ans=13;
		for(int i=13;i<=n;i++){
			if(is_prime[i-8]&&is_prime[i-6]&&is_prime[i-2]&&is_prime[i])
				ans=i;
		}
		cout<<ans<<endl;
	}
	return 0;
}

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

#include<iostream>

char p[10000001];

void sieve()
{
	memset( p, 1, sizeof( p ) );
	p[0] = p[1] = 0;

	for( int i = 2; i <= 10000000; ++i )
		if( p[i] )
			for( int j = i * 2; j <= 10000000; j += i )
				p[j] = 0;

	return;
}

int main()
{
	sieve();

	int n;
	while( std::cin >> n, n )
	{
		while( true )
		{
			if( p[n] && p[n-2] && p[n-6] && p[n-8] )
			{
				std::cout << n << std::endl;
				break;
			}

			--n;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'void sieve()':
a.cc:7:9: error: 'memset' was not declared in this scope
    7 |         memset( p, 1, sizeof( p ) );
      |         ^~~~~~
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++

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int n = 0,maxPQ = 0;
	
	while(sc.hasNext()){
	    n = sc.nextInt();
	    if(n==0) break;
	    
	    boolean[] check = new boolean[n];

	    System.out.println(checkPrime(check));
	}
    }

    static int checkPrime(boolean[] check){ // テ・ツ崢崚」ツ?、テ・ツュツ静ァツエツ?ヲツ閉ーテ」ツつ津ィツソツ氾」ツ??
	
	for(int i = 1;i*i<check.length;i++){ // テ」ツ?敕」ツつ古」ツ?古ァツエツ?ヲツ閉ーテ」ツ??」ツ?」テ」ツ?淌」ツつ嘉」ツ?敕」ツ?ョテ・ツ?催ヲツ閉ーテ」ツつ断alseテ」ツ?ォテ」ツ?凖」ツつ?
	    if(!primeNum(i+1)) notPrime(check,i+1);
	}

	for(int i = check.length-1;i>=0;i--){ // trueテ」ツつ津」ツ?ソテ」ツ?、テ」ツ?妥」ツ?淌」ツつ嘉」ツ?敕」ツ?ョテ、ツクツ凝」ツ?ィテ」ツ?凝」ツつづィツヲツ凝」ツ?ヲテ」ツ?｛kテ」ツ??」ツ?」テ」ツ?淌」ツつ嘉」ツ?敕」ツつ古」ツ?古ヲツ慊?・ツ、ツァテ」ツ?ョテヲツ閉ーテ」ツ??」ツ?療ィツソツ氾」ツ?療」ツ?。テ」ツつε」ツ??
	    if(!check[i] && !check[i-2] && !check[i-6] && !check[i-8]){
		return i+1;
	    }
	}

	return 0; // テ、ツサツョ
	
    }
    static boolean primeNum(int num){ // テァツエツ?ヲツ閉ーテ」ツつ津ヲツ閉ーテ」ツ?暗」ツつ?
	int count=0;
	for(int i = 1;i<=num;i++){
	    if(num%i==0) count++;
	}
	return count==2?false:true;
    }
    static void notPrime(boolean[] check,int n){ // テァツエツ?ヲツ閉ーテ」ツ??」ツ?」テ」ツ?淌ヲツ閉ーテ」ツ?ョテ・ツ?催ヲツ閉ーテ」ツつ稚rueテ」ツ?ォ
	for(int i = 2;i*n<check.length;i++){
	    check[(n*i)-1] = true;
	}
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
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.*;
import java.lang.*;
import java.math.*;
import java.io.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main{

	Scanner sc=new Scanner(System.in);

	int INF=1<<28;
	double EPS=1e-9;

	int m, n;
	R r0;
	int[][] a;

	void run(){
		/*
		byte[][][][] d=new byte[50][50][50][50];
		boolean[][][][] b=new boolean[50][50][50][50];*/
		for(;;){
			m=sc.nextInt();
			n=sc.nextInt();
			if((m|n)==0){
				break;
			}
			int tx=sc.nextInt()-1;
			int ty=sc.nextInt()-1;
			int kx=sc.nextInt()-1;
			int ky=sc.nextInt()-1;
			r0=new R(tx, ty, kx, ky);
			a=new int[n][m];
			for(int j=0; j<n; j++){
				for(int i=0; i<m; i++){
					a[j][i]=sc.nextInt();
				}
			}
			solve();
		}
	}

	void solve(){
		LinkedList<R> que=new LinkedList<R>();
		boolean[][][][] visited=new boolean[n][m][n][m];
		byte[][][][] d=new byte[n][m][n][m];

		// que.offer(new R)
		int[] dx={0, 0, -1, 1};
		int[] dy={-1, 1, 0, 0};
		que.offer(r0);

		for(; !que.isEmpty();){
			R r=que.poll();
			// debug(r.tx, r.ty, r.kx, r.ky, d[r.ty][r.tx][r.ky][r.kx]);
			if(d[r.ty][r.tx][r.ky][r.kx]>=100){
				println("NA");
				return;
			}
			if(r.tx==r.kx&&r.ty==r.ky){
				println(d[r.ty][r.tx][r.ky][r.kx]+"");
				return;
			}
			for(int i=0; i<4; i++){
				int tx2=min(max(r.tx+dx[i], 0), m-1);
				int ty2=min(max(r.ty+dy[i], 0), n-1);
				int kx2=min(max(r.kx-dx[i], 0), m-1);
				int ky2=min(max(r.ky-dy[i], 0), n-1);
				if(a[ty2][tx2]==1){
					tx2=r.tx;
					ty2=r.ty;
				}
				if(a[ky2][kx2]==1){
					kx2=r.kx;
					ky2=r.ky;
				}
				if(!visited[ty2][tx2][ky2][kx2]){
					visited[ty2][tx2][ky2][kx2]=true;
					que.offer(new R(tx2, ty2, kx2, ky2));
					d[ty2][tx2][ky2][kx2]=d[r.ty][r.tx][r.ky][r.kx]+1;
				}
			}
		}
		println("NA");
	}

	class R{
		int tx, ty, kx, ky;

		R(int tx, int ty, int kx, int ky){
			this.tx=tx;
			this.ty=ty;
			this.kx=kx;
			this.ky=ky;
		}
	}

	void debug(Object... os){
		System.err.println(Arrays.deepToString(os));
	}

	void print(String s){
		System.out.print(s);
	}

	void println(String s){
		System.out.println(s);
	}

	public static void main(String[] args){
		// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		new Main().run();
	}
}

Compiler output:
Main.java:82: error: incompatible types: possible lossy conversion from int to byte
					d[ty2][tx2][ky2][kx2]=d[r.ty][r.tx][r.ky][r.kx]+1;
					                                               ^
1 error
Language: C

6 6
2 4
6 2
0 0 0 0 1 0
0 1 0 0 0 0
0 1 0 0 0 0
0 0 0 1 0 0
0 0 0 0 0 1
0 0 0 0 0 0
3 3
1 1
3 3
0 0 0
0 1 0
0 0 0
0 0

Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 6 6
      | ^
Language: C

#include<stdio.h>
#include<queue>
using namespace std;
queue<int> tx, ty, kx, ky;
int d[50][50];
void move(void);
void clean(void);
int main(void)
{
	int x, y, X, Y,i,j;
	while (1) {
		for (i = 0; i < 50; i++) {
			for (j = 0; j < 50; j++) {
				d[i][j] = 1;
			}
		}
		scanf("%d %d", &X, &Y);   //????????????
		if (X == 0 && Y == 0) break;
		scanf("%d %d", &x, &y);   //????????????
		tx.push(x);  ty.push(y);
		scanf("%d %d", &x, &y);   //????????????
		kx.push(x);  ky.push(y);
		for (i = 1; i <= Y; i++) {
			for (j = 1; j <= X; j++) {
				scanf("%d", &d[i][j]);
			}
		}
		move();
		clean();
	}
	return 0;
}

void move()
{
	int cnt = 0,count=0,s=4;
	int m[4][4]={-1,1,0,0,      //taka y
				 0,0,-1,1,      //taka x
				 1,-1,0,0,      //kazu y
				 0,0,1,-1};     //kazu x
	while (1) {
		if (tx.back() == kx.back() && ty.back() == ky.back()) {
			printf("A%d\n", count);
			break;
		}
		if (d[ty.front() + m[0][cnt%4]][tx.front() + m[1][cnt%4]] == 0) {              //?????????
			tx.push(tx.front() + m[1][cnt%4]);
			ty.push(ty.front() + m[0][cnt%4]);
		}
		else if (d[ty.front() + m[0][cnt%4]][tx.front() + m[1][cnt%4]] == 1) {
			tx.push(tx.front());
			ty.push(ty.front());
		}
		if (d[ky.front() + m[2][cnt%4]][kx.front() + m[3][cnt%4]] == 0) {              //?????????
			kx.push(kx.front() + m[3][cnt%4]);
			ky.push(ky.front() + m[2][cnt%4]);
		}
		else if (d[ky.front() + m[2][cnt%4]][kx.front() + m[3][cnt%4]] == 1) {
			kx.push(kx.front());
			ky.push(ky.front());
		}

		cnt++;
		
		if(cnt == s){
			count++;
			s = s * s;
			cnt = 0;
			printf("\nQQQ\n");
		}
		//printf("%d ??????x.%d y.%d   ??????x.%d y.%d\n",cnt%4, tx.back(),ty.back(), kx.back(),ky.back());
		//printf("X %d %d\nY %d %d",kx.front(),m[3][cnt%4],ky.front(),m[2][cnt%4]);
		if (tx.back() == kx.back() && ty.back() == ky.back()) {
			printf("%d\n", count+1);
			break;
		}
	
		if(cnt % 4 == 0 && cnt !=0){
			tx.pop();  ty.pop();  kx.pop();  ky.pop();
		}
		if (count >= 100) {
			printf("NA\n");
			break;
		}
	}
}

void clean(void)
{
	while (!tx.empty()) {
		tx.pop();
	}
	while (!ty.empty()) {
		ty.pop();
	}
	while (!kx.empty()) {
		kx.pop();
	}
	while (!ky.empty()) {
		ky.pop();
	}
}

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

#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>

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 long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

const int INF = 1001001001;

struct Data
{
	int ty, tx, ky, kx, c;
	Data(int ty, int tx, int ky, int kx, int c) : ty(ty), tx(tx), ky(ky), kx(kx), c(c){}
};

bool visited[50][50][50][50];
int main()
{
	int w, h;
	while(scanf("%d%d", &w, &h), w){
		rep(i, h) rep(j, w) rep(k, h) rep(l, w)
			visited[i][j][k][l] = false;
		
		int ty, tx, ky, kx;
		scanf("%d%d%d%d", &tx, &ty, &kx, &ky);
		int depart[50][50];
		rep(i, h) rep(j, w)
			scanf("%d", &depart[i][j]);
		
		queue<Data> Q;
		Q.push(Data(ty-1, tx-1, ky-1, kx-1, 0));
		int ans = -1;
		while(!Q.empty()){
			Data d = Q.front();
			Q.pop();
			if(d.ty==d.ky && d.tx==d.kx){
				ans = d.c;
				break;
			}
			if(visited[d.ty][d.tx][d.ky][d.kx])
				continue;
			visited[d.ty][d.tx][d.ky][d.kx] = true;
			
			const int dy[] = {-1, 0, 1, 0};
			const int dx[] = {0, -1, 0, 1};
			rep(i, 4){
				int pty = d.ty + dy[i];
				int ptx = d.tx + dx[i];
				if(pty<0 || h<=pty || ptx<0 || w<=ptx || depart[pty][ptx]){
					pty = d.ty;
					ptx = d.tx;
				}
				int pky = d.ky - dy[i];
				int pkx = d.kx - dx[i];
				if(pky<0 || h<=pky || pkx<0 || w<=pkx || depart[pky][pkx]){
					pky = d.ky;
					pkx = d.kx;
				}
				if(d.c+1 < 100)
					Q.push(Data(pty, ptx, pky, pkx, d.c+1));
			}
		}
		if(ans == -1)
			puts("NA");
		else
			printf("%d\n", ans);
	}
	return 0;
}

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

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

int X, Y;

bool map[50][50];
bool passed[50][50][50][50];

struct P
{
    int tx, ty;
    int kx, ky;
    int cost;

    P(int _tx, int _ty, int _kx, int _ky, int _cost) : tx(_tx), ty(_ty), kx(_kx), ky(_ky), cost(_cost) {};
};

bool check(int x, int y)
{
    return x < 0 || x >= X || y < 0 || y >= Y || map[y][x];
}

int main()
{
    int tx, ty, kx, ky, ans;
    while(cin >> X >> Y, X|Y)
    {
        ans = -1;
        memset(passed, 0, sizeof passed);
        queue<P> que;

        cin >> tx >> ty >> kx >> ky;
        tx--, ty--, kx--, ky--;

        for(int i = 0; i < Y; i++)
            for(int j = 0; j < X; j++)
                cin >> map[i][j];

        passed[tx][ty][kx][ky] = true;

        for(que.push(P(tx, ty, kx, ky, 0)); !que.empty(); que.pop())
        {
            P p = que.front();

            if(p.cost >= 100)
                break;

            if(p.tx == p.kx && p.ty == p.ky)
            {
                ans = p.cost;
                break;
            }

            for(int i = 0; i < 4; i++)
            {
                int mtx = p.tx + dx[0][i], mty = p.ty + dy[0][i];
                int mkx = p.kx + dx[1][i], mky = p.ky + dy[1][i];

                if(check(mtx, mty))
                    mtx = p.tx, mty = p.ty;
                if(check(mkx, mky))
                    mkx = p.kx, mky = p.ky;
                if(passed[mtx][mty][mkx][mky])
                    continue;

                passed[mtx][mty][mkx][mky] = true;
                que.push(P(mtx, mty, mkx, mky, p.cost + 1));
            }
        }

        if(ans == -1)
            puts("NA");
        else
            cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:11: error: 'cin' was not declared in this scope
   26 |     while(cin >> X >> Y, X|Y)
      |           ^~~
a.cc:29:9: error: 'memset' was not declared in this scope
   29 |         memset(passed, 0, sizeof passed);
      |         ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | const int dx[][4] = {{1, 0, -1, 0}, {-1, 0, 1, 0}};
a.cc:30:9: error: 'queue' was not declared in this scope
   30 |         queue<P> que;
      |         ^~~~~
a.cc:30:16: error: expected primary-expression before '>' token
   30 |         queue<P> que;
      |                ^
a.cc:30:18: error: 'que' was not declared in this scope
   30 |         queue<P> que;
      |                  ^~~
a.cc:72:13: error: 'puts' was not declared in this scope
   72 |             puts("NA");
      |             ^~~~
a.cc:74:13: error: 'cout' was not declared in this scope
   74 |             cout << ans << endl;
      |             ^~~~
a.cc:74:28: error: 'endl' was not declared in this scope
   74 |             cout << ans << endl;
      |                            ^~~~
Language: C++

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


int H,W;
bool F[52][52]; //障害物
bool D[52][52][52][52]; //探索済みかの判定用
int inc_tx[4] = {1,-1,0,0};
int inc_ty[4] = {0,0,1,-1};
int inc_kx[4] = {-1,1,0,0};
int inc_ky[4] = {0,0,-1,1};

class Point{
public:
  int tx; //タカユキの座標
  int ty;
  int kx; //カズユキの座標
  int ky;
  int d; //ターン回数
  void set(int a,int b,int c,int d){
    tx = a;
    ty = b;
    kx = c;
    ky = d;
  }
};

bool is_out_of_area(int y,int x) //座標が範囲内か確認する関数
{
  return x < 1 || x > W || y < 1 || y > H || F[y][x];
}

int main(){
  
  while(1){
    
    Point p,q;
    int tx,ty,kx,ky;
    queue<Point> qa;
    cin >> W >> H;
    if(W == 0 && H == 0)
    break;
    cin >> tx >> ty >> kx >> ky;
    memset(F,1,sizeof(F));
    for(int y=1;y<=H;y++){
      for(int x=1;x<=W;x++){
        cin >> F[y][x];
      }
    }
    memset(D,1,sizeof(D));
    p.set(tx,ty,kx,ky);
    D[ty][tx][ky][kx] = 0;
    p.d = 0;
    qa.push(p);
    while(1){
      int inc_tx,inc_ty,inc_kx,inc_ky;
      if(qa.empty()){
        cout << "NA" <<endl;
        break;
      }
      p = qa.front();
      qa.pop();
      if(p.d >= 100){
        cout << "NA" << endl;
        break;
      }
      if(p.tx == p.kx && p.ty == p.ky){
        cout << p.d << endl;
        break;
      }
      for(int i=0;i<4;i++){
        q.tx = p.tx + inc_tx[i]; q.ty = p.ty + inc_ty[i];
        q.kx = p.kx + inc_kx[i]; q.ky = p.ky + inc_ky[i];
        if(D[q.ty][q.tx][q.ky][q.kx]){
          if(is_out_of_area(q.ty ,q.tx) == 0 || is_out_of_area(q.ky ,q.kx) == 0){
            if(is_out_of_area(q.ty ,q.tx)){
              q.ty = p.ty; q.tx = p.tx;
            }
            if(is_out_of_area(q.ky ,q.kx)){
              q.ky = p.ky; q.kx = p.kx;
            }
            q.d = p.d + 1;
            qa.push(q);
            D[q.ty][q.tx][q.ky][q.kx] = 0;
          }
        }
      }
    }
    while(!qa.empty()){
      qa.pop();
    } //キューの残りカスを消去
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:74:29: error: invalid types 'int[int]' for array subscript
   74 |         q.tx = p.tx + inc_tx[i]; q.ty = p.ty + inc_ty[i];
      |                             ^
a.cc:74:54: error: invalid types 'int[int]' for array subscript
   74 |         q.tx = p.tx + inc_tx[i]; q.ty = p.ty + inc_ty[i];
      |                                                      ^
a.cc:75:29: error: invalid types 'int[int]' for array subscript
   75 |         q.kx = p.kx + inc_kx[i]; q.ky = p.ky + inc_ky[i];
      |                             ^
a.cc:75:54: error: invalid types 'int[int]' for array subscript
   75 |         q.kx = p.kx + inc_kx[i]; q.ky = p.ky + inc_ky[i];
      |                                                      ^
Language: C++

#include <iostream>
#include <queue>
#include <algorithm>

using namespace std;

struct State{
  int tx, ty, kx, ky;
  State(int tx, int ty, int kx, int ky) : tx(tx), ty(ty), kx(kx), ky(ky) {} 
};

#define MAX 51
#define INF 1e9

int H, W, tx, ty, kx, ky;
int field[MAX][MAX];
const int ttx[] = {-1,0,0,1};
const int tty[] = {0,-1,1,0};
const int kkx[] = {1,0,0,-1};
const int kky[] = {0,1,-1,0};

bool inField(int y, int x){
  return 0 <= y && y < H && 0 <= x && x < W;
}

int bfs(){
  bool vis[MAX][MAX][MAX][MAX];
  memset(vis, false, sizeof(vis));
  vis[ty][tx][ky][kx] = true;
  queue<State> Q;
  Q.push(State(tx,ty,kx,ky));
  queue<int> cnt;
  cnt.push(0);

  int res = INF;
  while(!Q.empty()){
    State s = Q.front(); Q.pop();
    int _cnt = cnt.front(); cnt.pop();

    if(_cnt == 100) break;
    if(s.tx == s.kx && s.ty == s.ky){
      res = min(res, _cnt);
      break;
    }

    for(int i = 0 ; i < 4 ; i++){
      int ntx = s.tx + ttx[i], nty = s.ty + tty[i];
      int nkx = s.kx + kkx[i], nky = s.ky + kky[i];

      if(!inField(nty, ntx) || field[nty][ntx] == 1){
        ntx = s.tx, nty = s.ty;
      }
      if(!inField(nky, nkx) || field[nky][nkx] == 1){
        nkx = s.kx, nky = s.ky;
      }

      if(vis[nty][ntx][nky][nkx]) continue;
      vis[nty][ntx][nky][nkx] = true;
      Q.push(State(ntx, nty, nkx, nky));
      cnt.push(_cnt+1);
    }
  }
  return res;
}

int main(){
  while(cin >> W >> H, (W | H)){
    cin >> tx >> ty >> kx >> ky;
    tx--, ty--, kx--, ky--;
    for(int i = 0 ; i < H ; i++){
      for(int j = 0 ; j < W ; j++){
        cin >> field[i][j];
      }
    }
    int res = bfs();
    if(res == INF){
      cout << "NA" << endl;
    }else{
      cout << res << endl;
    }
  }

  return 0;
}

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

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
struct Data{
	int x1,y1,x2,y2,cnt;
	Data(){}
	Data(int x1,int y1,int x2,int y2,int cnt):
		x1(x1),y1(y1),x2(x2),y2(y2),cnt(cnt){}
};
bool memo[50][50][50][50];
int dx[] = {0,1,-1,0}, dy[] = {1,0,0,-1};
int main() {
	int x,y;
	while(scanf("%d%d",&x,&y),(x|y)) {
		int tx,ty;
		int kx,ky;
		scanf("%d%d",&tx,&ty);
		scanf("%d%d",&kx,&ky);
		tx--;ty--;kx--;ky--;
		int stage[51][51];
		for(int i = 0; i < y; i++) {
			for(int j = 0; j < x; j++) {
				scanf("%d",&stage[i][j]);
			}
		}
		memset(memo,0,sizeof(memo));
		queue<Data> Q;
		Q.push(Data(tx,ty,kx,ky,0));
		int ans = -1;
		while(!Q.empty()) {
			Data d = Q.front();Q.pop();
			if(d.cnt >= 100) break;
			if(d.x1 == d.x2 && d.y1 == d.y2) {
				ans = d.cnt;
				break;
			}
			if(memo[d.x1][d.y1][d.x2][d.y2]) continue;
			memo[d.x1][d.y1][d.x2][d.y2] = true;
			for(int i = 0; i < 4; i++) {
				bool flg1 = false,flg2 = false;
				int nx1 = dx[i] + d.x1, ny1 = dy[i] + d.y1;
				int nx2 = dx[3-i] + d.x2, ny2 = dy[3-i] + d.y2;
				if(nx1 < 0 || nx1 >= x || ny1 < 0 || ny1 >= y || stage[ny1][nx1] == 1) flg1 = true;
				if(nx2 < 0 || nx2 >= x || ny2 < 0 || ny2 >= y || stage[ny2][nx2] == 1) flg2 = true;
				if(!(flg1 | flg2)) {
					Q.push(Data(nx1,ny1,nx2,ny2,d.cnt + 1));
				}
				if(!flg1 && flg2) {
					Q.push(Data(nx1,ny1,d.x2,d.y2,d.cnt+1));
				}
				if(flg1 && !flg2) {
					Q.push(Data(d.x1,d.y1,nx2,ny2,d.cnt+1));
				}
			}
		}
		if(ans == -1) puts("NA");
		else printf("%d\n",ans);
	}
	return 0;
}

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

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

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30

using namespace std;

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

struct Data
{
	int tx,ty,kx,ky,cost;

	Data(int tx,int ty,int kx,int ky,int cost) : tx(tx),ty(ty),kx(kx),ky(ky),cost(cost) {}
};

int main()
{
	int x,y;
	while(cin >> x >> y)
	{
		if(x == 0 && y == 0) break;

		int tx,ty,kx,ky;
		cin >> tx >> ty >> kx >> ky;

		tx--;
		ty--;
		kx--;
		ky--;

Compiler output:
a.cc: In function 'int main()':
a.cc:37:22: error: expected '}' at end of input
   37 |                 ky--;
      |                      ^
a.cc:28:9: note: to match this '{'
   28 |         {
      |         ^
a.cc:37:22: error: expected '}' at end of input
   37 |                 ky--;
      |                      ^
a.cc:25:1: note: to match this '{'
   25 | {
      | ^
Language: C++

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

int x,y,tx,ty,kx,ky,cou;
int mas[111][111];
int ans=0;
bool used[111][111][111][111];
int dx[]={-1,0,0,1};
int dy[]={0,-1,1,0};
struct P{
  int tx,ty,kx,ky,cou;
  P(int tx,int ty,int kx,int ky,int cou):tx(tx),ty(ty),kx(kx),ky(ky),cou(cou){}
};
int bfs();

int main(){
  while(1){
    cin >> x >> y;
    if(x==0 && y==0) break;
    memset(used,false,sizeof(used));
    cin >> tx >> ty;
    cin >> kx >> ky;
    for(int i=0;i<y;i++){
      for(int j=0;j<x;j++){
	cin >> mas[i][j];
      }
    }
    ans = bfs();
    if(ans==-1) cout << "NA" << endl;
    else cout << ans << endl;
  }
}

int bfs(){
  queue<P> que;
  que.push(P(tx-1,ty-1,kx-1,ky-1,0));
  used[tx-1][ty-1][kx-1][ky-1] = true;
  while(!que.empty()){
    P p=que.front();
    if(p.tx==p.kx && p.ty==p.ky) return p.cou;
    else if(p.cou>=100) return -1;
    for(int i=0;i<4;i++){
      int ntx=p.tx+dx[i];
      int nty=p.ty+dy[i];
      int nkx=p.kx+dx[3-i];
      int nky=p.ky+dy[3-i];
      if(ntx<0 || ntx>=x || nty<0 || nty>=y || mas[nty][ntx]==1){
	ntx=p.tx;
	nty=p.ty;
      }
      if(nkx<0 || nkx>=x || nky<0 || nky>=y || mas[nky][nkx]==1){
	nkx=p.kx;
	nky=p.ky;
      }
      if(used[ntx][nty][nkx][nky]==false){
	que.push(P(ntx,nty,nkx,nky,p.cou+1));
	used[ntx][nty][nkx][nky] = true;
      }
    }
    que.pop();
  }
  return -1;
}

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

#include<iostream>
#include<utility>
#include<complex>
#include<queue>
using namespace std;

typedef complex<int> P;

int X, Y;
bool field[54][54];
const P dx[4] = { P(1, 0), P(0, 1), P(-1, 0), P(0, -1) };

struct Node {
  int rap;
  P tak, kaz;
};

bool in_room(P p) {
  int x = p.real(), y = p.imag();
  return (0 <= x && x < X && 0 <= y && y < Y && !field[x][y]);
}

int main() {
  while (cin >> X >> Y and X) {
    int tx, ty, kx, ky;
    cin >> tx >> ty >> kx >> ky;
    P tak(--tx, --ty), kaz(--kx, --ky);
    for (int y = 0; y < Y; y++) {
      for (int x = 0; x < X; x++) {
        cin >> field[x][y];
      }
    }

    queue<Node> que;
    que.push((Node){tak, kaz});

    bool found = false;

    while (!que.empty()) {
      Node node = que.front(); que.pop();
      if (node.tak == node.kaz) {
        cout << "HOGE" << endl;
        found = true;
        break;
      }

      for (int i = 0; i < 4; i++) {
        Node new_node{node.rap+1, node.tak+dx[i], node.kaz-dx[i]};
        if (!in_room(new_node.tak)) new_node.tak = node.tak;
        if (!in_room(new_node.kaz)) new_node.kaz = node.kaz;
        que.push(new_node);
      }
    }
    if (not found) {
      cout << "NA" << endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:21: error: cannot convert 'P' {aka 'std::complex<int>'} to 'int' in initialization
   35 |     que.push((Node){tak, kaz});
      |                     ^~~
      |                     |
      |                     P {aka std::complex<int>}
Language: C++

#include <iostream>
#include <queue>
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
using namespace std;
bool mem[52][52][52][52] = {{{{}}}};
struct S{
	int a,b,c,d,t;
};
int dx[4] = {-1,0,1,0};
int dy[4] = {0,1,0,-1};
void init() {
	memset(mem,0,sizeof(mem));
}
int main(){
	int x, y, tx, ty, kx, ky, k;
	while(cin >> x >> y, (x || y)) {
		int b[52][52] = {};
		init();
		cin >> tx >> ty >> kx >> ky;
		rep(i,y) {
			rep(j,x) {
				cin >> k;
				b[i+1][j+1] = 1-k;
			}
		}
		queue<S> q;
		S s = {tx,ty,kx,ky,0};
		q.push(s);
		while(!q.empty()) {
			S s = q.front();
			if(q.front().t >= 100) break;
			if(s.a==s.c&&s.b==s.d) break;
			q.pop();
			if(mem[s.a][s.b][s.c][s.d]++) continue;
			rep(i,4) {
				int na = s.a+dx[i], nb = s.b+dy[i], nc = s.c+dx[(i+2)%4], nd = s.d+dy[(i+2)%4];
				if(!b[nb][na]&&!b[nd][nc]) continue;
				if(!b[nb][na]) na = s.a, nb = s.b;
				if(!b[nd][nc]) nc = s.c, nd = s.d;
				S ns = {na, nb, nc, nd, s.t+1};
				q.push(ns);
			}
		}
		if(q.empty()) cout << "NA" << endl;
		else if(q.front().t >= 100) cout << "NA" << endl;
		else cout << q.front().t << endl;
	}
}

Compiler output:
a.cc: In function 'void init()':
a.cc:13:9: error: 'memset' was not declared in this scope
   13 |         memset(mem,0,sizeof(mem));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <queue>
  +++ |+#include <cstring>
    3 | #define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
a.cc: In function 'int main()':
a.cc:35:50: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   35 |                         if(mem[s.a][s.b][s.c][s.d]++) continue;
      |                            ~~~~~~~~~~~~~~~~~~~~~~^
Language: C++

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

#define INF (1 << 25)

using namespace std;

vector<vector<vector<vector<int> > > > dp;

vector<vector<int> > M;

int H, W, sx1, sy1, sx2, sy2;

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

int bfs()
{
    dp = vector<vector<vector<vector<int> > > >(H, vector<vector<vector<int> > >(W, vector<vector<int> >(H, vector<int>(W, INF)))); dp[sy1][sx1][sy2][sx2] = 0;
    
    queue<pair<pair<pair<int, int>, pair<int, int> >, int> > que; que.push(make_pair(make_pair(make_pair(sx1, sy1), make_pair(sx2, sy2)), 0));
    
    while(!que.empty())
    {
        int x1 = que.front().first.first.first;
        int y1 = que.front().first.first.second;
        int x2 = que.front().first.second.first;
        int y2 = que.front().first.second.second;
        
        int turn = que.front().second;
        
        que.pop();
        
        for(int dir = 0; dir < 4; dir++)
        {
            int tx1 = x1 + dx[dir]; if(tx1 < 0 || tx1 > W) { tx1 -= dx[dir]; }
            int ty1 = y1 + dy[dir]; if(ty1 < 0 || ty1 > H) { ty1 -= dy[dir]; }
            int tx2 = x2 - dx[dir]; if(tx2 < 0 || tx2 > W) { tx2 += dx[dir]; }
            int ty2 = y2 - dy[dir]; if(ty2 < 0 || ty2 > H) { ty2 += dy[dir]; }
            
            if(M[ty1][tx1] == 1) { tx1 -= dx[dir]; ty1 -= dy[dir]; }
            if(M[ty2][tx2] == 1) { tx2 += dx[dir]; ty2 += dy[dir]; }
            
            if(tx1 == tx2 && ty1 == ty2) { return turn + 1; }
            
            if(dp[ty1][tx1][ty2][tx2] == INF)
            {
                dp[ty1][tx1][ty2][tx2] = turn + 1;
                
                que.push(make_pair(make_pair(make_pair(tx1, ty1), make_pair(tx2, ty2)), turn + 1);
            }
        }
    }
    
    return -1;
}

int main()
{
    while(true)
    {
        cin >> W >> H;
        
        if(H == 0 && W == 0) { break; }
        
        M = vector<vector<int> >(H, vector<int>(W));
        
        cin >> sx1 >> sy1 >> sx2 >> sy2;
        
        sx1--; sy1--; sx2--; sy2--;
        
        for(int i = 0; i < H; i++)
        {
            for(int j = 0; j < W; j++)
            {
                cin >> M[i][j];
            }
        }
        
        int Ans = bfs();
        
        cout << (Ans == -1 ? "NA" : Ans) << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int bfs()':
a.cc:51:98: error: expected ')' before ';' token
   51 |                 que.push(make_pair(make_pair(make_pair(tx1, ty1), make_pair(tx2, ty2)), turn + 1);
      |                         ~                                                                        ^
      |                                                                                                  )
a.cc: In function 'int main()':
a.cc:83:28: error: operands to '?:' have different types 'const char*' and 'int'
   83 |         cout << (Ans == -1 ? "NA" : Ans) << endl;
      |                  ~~~~~~~~~~^~~~~~~~~~~~
Language: C++

#include<queue>
#include<iostream>
#include<algorithm>
#include <conio.h>
using namespace std;
struct maigo{
	int x[2];// ????????????[0]???????????????[1]
	int y[2];// ????????????[0]???????????????[1]
	int count = 1;
};
int main(){
	queue<maigo> q;
	int tx, ty; int kx, ky;
	int **depart, X, Y;
	int flag = 0, a = 0;
	cin >> X >> Y;
	while (X != 0 && Y != 0){
		depart = new int*[Y + 2];
		for (int i = 0; i < Y + 2; i++){
			depart[i] = new int[X + 2];
		}
		for (int i = 0; i < Y + 2; i++){
			for (int l = 0; l < X + 2; l++){
				depart[i][l] = 3;
			}
		}
		cin >> tx >> ty;
		cin >> kx >> ky;
		for (int i = 1; i < Y + 1; i++){
			for (int l = 1; l < X + 1; l++){
				cin >> depart[i][l];
			}
		}
		maigo temp;
		temp.x[0] = tx; temp.y[0] = ty;
		temp.x[1] = kx; temp.y[1] = ky;
		q.push(temp);
		while (!q.empty() && flag == 0){
			maigo t = q.front();
			q.pop();
			int dx1[4] = { 1, 0, -1, 0 }; int dx2[4] = { 0, 1, 0, -1 };
			for (int i = 0; i < 4; i++){
				if (depart[t.x[0] + dx1[i]][t.y[0] + dx2[i]] == 0 &&
					depart[t.x[1] + dx1[i] * (-1)][t.y[1] + dx2[i] * (-1)] == 0){
					depart[t.x[0] + dx1[i]][t.y[0] + dx2[i]] = -1;
					depart[t.x[1] + dx1[i] * (-1)][t.y[1] + dx2[i] * (-1)] = -1;
					if (t.x[0] + dx1[i] == t.x[1] + dx1[i] * (-1) &&
						t.y[0] + dx2[i] == t.y[1] + dx2[i] * (-1)){
						cout << t.count << endl;
						flag = 1;
					}
					maigo into;
					into.x[0] = t.x[0] + dx1[i], into.y[0] = t.y[0] + dx2[i];
					into.x[1] = t.x[1] + dx1[i] * (-1), into.y[1] = t.y[1] + dx2[i] * (-1);
					into.count = t.count + 1;
					if (into.count >= 100){
						flag = 1;
						a = 1;
					}
					q.push(into);
				}
			}
		}if (a == 1||flag == 0) {
			cout << "NA" << endl;
		}while (!q.empty()) q.pop();
		a = 0; flag = 0;
		cin >> X >> Y;
	}
	return 0;
}

Compiler output:
a.cc:4:10: fatal error: conio.h: No such file or directory
    4 | #include <conio.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include<queue>
#include<iostream>
#include<algorithm>
#include <conio.h>
using namespace std;
struct maigo{
	int x[2];
	int y[2];
	int count = 1;
};
int main(){
	queue<maigo> q;
	int tx, ty; int kx, ky;
	int **depart, X, Y;
	int flag = 0, a = 0;
	cin >> X >> Y;
	while (X != 0 && Y != 0){
		depart = new int*[Y + 2];
		for (int i = 0; i < Y + 2; i++){
			depart[i] = new int[X + 2];
		}
		for (int i = 0; i < Y + 2; i++){
			for (int l = 0; l < X + 2; l++){
				depart[i][l] = 3;
			}
		}
		cin >> tx >> ty;
		cin >> kx >> ky;
		for (int i = 1; i < Y + 1; i++){
			for (int l = 1; l < X + 1; l++){
				cin >> depart[i][l];
			}
		}
		maigo temp;
		temp.x[0] = tx; temp.y[0] = ty;
		temp.x[1] = kx; temp.y[1] = ky;
		q.push(temp);
		while (!q.empty() && flag == 0){
			maigo t = q.front();
			q.pop();
			int dx1[4] = { 1, 0, -1, 0 }; int dx2[4] = { 0, 1, 0, -1 };
			for (int i = 0; i < 4; i++){
				if (depart[t.x[0] + dx1[i]][t.y[0] + dx2[i]] == 0 &&
					depart[t.x[1] + dx1[i] * (-1)][t.y[1] + dx2[i] * (-1)] == 0){
					depart[t.x[0] + dx1[i]][t.y[0] + dx2[i]] = -1;
					depart[t.x[1] + dx1[i] * (-1)][t.y[1] + dx2[i] * (-1)] = -1;
					if (t.x[0] + dx1[i] == t.x[1] + dx1[i] * (-1) &&
						t.y[0] + dx2[i] == t.y[1] + dx2[i] * (-1)){
						cout << t.count << endl;
						flag = 1;
					}
					maigo into;
					into.x[0] = t.x[0] + dx1[i], into.y[0] = t.y[0] + dx2[i];
					into.x[1] = t.x[1] + dx1[i] * (-1), into.y[1] = t.y[1] + dx2[i] * (-1);
					into.count = t.count + 1;
					if (into.count >= 100){
						flag = 1;
						a = 1;
					}
					q.push(into);
				}
			}
		}if (a == 1||flag == 0) {
			cout << "NA" << endl;
		}while (!q.empty()) q.pop();
		a = 0; flag = 0;
		cin >> X >> Y;
	}
	return 0;
}

Compiler output:
a.cc:4:10: fatal error: conio.h: No such file or directory
    4 | #include <conio.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include<queue>
#include<iostream>
#include<algorithm>
#include <conio.h>
using namespace std;
struct maigo{
	int x[2];// ????????????[0]???????????????[1]
	int y[2];// ????????????[0]???????????????[1]
	int count;
};
int main(){
	queue<maigo> q;
	int tx, ty; int kx, ky;
	int **depart, X, Y;
	int flag = 0, a = 0;
	cin >> X >> Y;
	while (X != 0 && Y != 0){
		depart = new int*[Y + 2];
		for (int i = 0; i < Y + 2; i++){
			depart[i] = new int[X + 2];
		}
		for (int i = 0; i < Y + 2; i++){
			for (int l = 0; l < X + 2; l++){
				depart[i][l] = 3;
			}
		}
		cin >> tx >> ty;
		cin >> kx >> ky;
		for (int i = 1; i < Y + 1; i++){
			for (int l = 1; l < X + 1; l++){
				cin >> depart[i][l];
			}
		}
		maigo temp;
		temp.x[0] = tx; temp.y[0] = ty;
		temp.x[1] = kx; temp.y[1] = ky;
		temp.count = 1;
		q.push(temp);
		while (!q.empty() && flag == 0){
			maigo t = q.front();
			q.pop();
			int dx1[4] = { 1, 0, -1, 0 }; int dx2[4] = { 0, 1, 0, -1 };
			for (int i = 0; i < 4; i++){
				if (depart[t.x[0] + dx1[i]][t.y[0] + dx2[i]] == 0 &&
					depart[t.x[1] + dx1[i] * (-1)][t.y[1] + dx2[i] * (-1)] == 0){
					depart[t.x[0] + dx1[i]][t.y[0] + dx2[i]] = -1;
					depart[t.x[1] + dx1[i] * (-1)][t.y[1] + dx2[i] * (-1)] = -1;
					if (t.x[0] + dx1[i] == t.x[1] + dx1[i] * (-1) &&
						t.y[0] + dx2[i] == t.y[1] + dx2[i] * (-1)){
						cout << t.count << endl;
						flag = 1;
					}
					maigo into;
					into.x[0] = t.x[0] + dx1[i], into.y[0] = t.y[0] + dx2[i];
					into.x[1] = t.x[1] + dx1[i] * (-1), into.y[1] = t.y[1] + dx2[i] * (-1);
					into.count = t.count + 1;
					if (into.count >= 100){
						flag = 1;
						a = 1;
					}
					q.push(into);
				}
			}
		}if (a == 1||flag == 0) {
			cout << "NA" << endl;
		}while (!q.empty()) q.pop();
		a = 0; flag = 0;
		cin >> X >> Y;
	}
	return 0;
}

Compiler output:
a.cc:4:10: fatal error: conio.h: No such file or directory
    4 | #include <conio.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<algorithm>
#include <conio.h>
using namespace std;
struct maigo{
	int x[2];// ????????????[0]???????????????[1]
	int y[2];// ????????????[0]???????????????[1]
	int count;
};
int main(){
	queue<maigo> q;
	int tx, ty; int kx, ky;
	int **depart, X, Y;
	int flag = 0, a = 0;
	cin >> X >> Y;
	while (X != 0 && Y != 0){
		depart = new int*[Y + 2];
		for (int i = 0; i < Y + 2; i++){
			depart[i] = new int[X + 2];
		}
		for (int i = 0; i < Y + 2; i++){
			for (int l = 0; l < X + 2; l++){
				depart[i][l] = 3;
			}
		}
		cin >> tx >> ty;
		cin >> kx >> ky;
		for (int i = 1; i < Y + 1; i++){
			for (int l = 1; l < X + 1; l++){
				cin >> depart[i][l];
			}
		}
		maigo temp;
		temp.x[0] = tx; temp.y[0] = ty;
		temp.x[1] = kx; temp.y[1] = ky;
		temp.count = 1;
		q.push(temp);
		while (!q.empty() && flag == 0){
			maigo t = q.front();
			q.pop();
			int dx1[4] = { 1, 0, -1, 0 }; int dx2[4] = { 0, 1, 0, -1 };
			for (int i = 0; i < 4; i++){
				if (depart[t.x[0] + dx1[i]][t.y[0] + dx2[i]] == 0 &&
					depart[t.x[1] + dx1[i] * (-1)][t.y[1] + dx2[i] * (-1)] == 0){
					depart[t.x[0] + dx1[i]][t.y[0] + dx2[i]] = -1;
					depart[t.x[1] + dx1[i] * (-1)][t.y[1] + dx2[i] * (-1)] = -1;
					if (t.x[0] + dx1[i] == t.x[1] + dx1[i] * (-1) &&
						t.y[0] + dx2[i] == t.y[1] + dx2[i] * (-1)){
						cout << t.count << endl;
						flag = 1;
					}
					maigo into;
					into.x[0] = t.x[0] + dx1[i], into.y[0] = t.y[0] + dx2[i];
					into.x[1] = t.x[1] + dx1[i] * (-1), into.y[1] = t.y[1] + dx2[i] * (-1);
					into.count = t.count + 1;
					if (into.count >= 100){
						flag = 1;
						a = 1;
					}
					q.push(into);
				}
			}
		}if (a == 1||flag == 0) {
			cout << "NA" << endl;
		}while (!q.empty()) q.pop();
		a = 0; flag = 0;
		cin >> X >> Y;
	}
	return 0;
}

Compiler output:
a.cc:3:10: fatal error: conio.h: No such file or directory
    3 | #include <conio.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
struct maigo{
	int x[2];// ????????????[0]???????????????[1]
	int y[2];// ????????????[0]???????????????[1]
	int count;
};
int main(){
	queue<maigo> q;
	int tx, ty; int kx, ky;
	int **depart, X, Y;
	int flag = 0, a = 0;
	cin >> X >> Y;
	while (X != 0 && Y != 0){
		depart = new int*[Y + 2];
		for (int i = 0; i < Y + 2; i++){
			depart[i] = new int[X + 2];
		}
		for (int i = 0; i < Y + 2; i++){
			for (int l = 0; l < X + 2; l++){
				depart[i][l] = 3;
			}
		}
		cin >> tx >> ty;
		cin >> kx >> ky;
		for (int i = 1; i < Y + 1; i++){
			for (int l = 1; l < X + 1; l++){
				cin >> depart[i][l];
			}
		}
		maigo temp;
		temp.x[0] = tx; temp.y[0] = ty;
		temp.x[1] = kx; temp.y[1] = ky;
		temp.count = 1;
		q.push(temp);
		while (!q.empty() && flag == 0){
			maigo t = q.front();
			q.pop();
			int dx1[4] = { 1, 0, -1, 0 }; int dx2[4] = { 0, 1, 0, -1 };
			for (int i = 0; i < 4; i++){
				if (depart[t.x[0] + dx1[i]][t.y[0] + dx2[i]] == 0 &&
					depart[t.x[1] + dx1[i] * (-1)][t.y[1] + dx2[i] * (-1)] == 0){
					depart[t.x[0] + dx1[i]][t.y[0] + dx2[i]] = -1;
					depart[t.x[1] + dx1[i] * (-1)][t.y[1] + dx2[i] * (-1)] = -1;
					if (t.x[0] + dx1[i] == t.x[1] + dx1[i] * (-1) &&
						t.y[0] + dx2[i] == t.y[1] + dx2[i] * (-1)){
						cout << t.count << endl;
						flag = 1;
					}
					maigo into;
					into.x[0] = t.x[0] + dx1[i], into.y[0] = t.y[0] + dx2[i];
					into.x[1] = t.x[1] + dx1[i] * (-1), into.y[1] = t.y[1] + dx2[i] * (-1);
					into.count = t.count + 1;
					if (into.count >= 100){
						flag = 1;
						a = 1;
					}
					q.push(into);
				}
			}
		}if (a == 1||flag == 0) {
			cout << "NA" << endl;
		}while (!q.empty()) q.pop();
		a = 0; flag = 0;
		cin >> X >> Y;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'queue' was not declared in this scope
   10 |         queue<maigo> q;
      |         ^~~~~
a.cc:3:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    2 | #include<algorithm>
  +++ |+#include <queue>
    3 | using namespace std;
a.cc:10:20: error: expected primary-expression before '>' token
   10 |         queue<maigo> q;
      |                    ^
a.cc:10:22: error: 'q' was not declared in this scope
   10 |         queue<maigo> q;
      |                      ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<queue>
using namespace std;
struct oza{
	int x;
	int y;
};
int A[52][52][52][52];
int main(){
	oza k;
	oza t;
	queue<oza> ka;
	queue<oza> ta;
	queue<int> Z;
	int  w,h,b;
	int d=0,c=0,i=0,j=0,l=-1,D[52][52];
	int tx[4]={ 1, 0,-1,0 };       
	int kx[4]={-1, 0, 1,0 };
	int ty[4]={ 0, 1, 0,-1 };
	int ky[4]={ 0, -1, 0,1};
	scanf("%d %d",&w,&h);
	while(w!=0&&h!=0){
	memset(A,0,sizeof(A));
		for(i=0;i<=h+1;i++){
		for(j=0;j<=w+1;j++){
		D[i][j]=1; 
		}
	}

	scanf("%d %d",&t.x,&t.y);
	scanf("%d %d",&k.x,&k.y);
	for(i=1;i<=h;i++){
		for(j=1;j<=w;j++){
		scanf("%d",&D[i][j]);
		}
	}
	ta.push(t);
	ka.push(k);
	Z.push(c);
		if(t.x==k.x&&t.y==k.y){
			d=-1;
		}
	while(d!=-1){
		l++;
		if(l==4){
		l=0;
		t=ta.front();
		k=ka.front();
		ka.pop();
		ta.pop();
		Z.pop();
		A[t.x][t.y][k.x][k.y]=1;
		}
		if(c==100||Z.empty()){
			printf("NA");
		break;
		}
	
		t=ta.front();
		k=ka.front();
		c=Z.front();
		t.x=t.x+tx[l];
		t.y=t.y+ty[l];
		k.x=k.x+kx[l];
		k.y=k.y+ky[l];
		
		

		
		if(D[t.x][t.y]==1){
		t.x=t.x-tx[l];
		t.y=t.y-ty[l];
		}
		if(D[k.x][k.y]==1){
		k.x=k.x-kx[l];
		k.y=k.y-ky[l];
		}
		if(A[t.x][t.y][k.x][k.y]==1){
			continue;
		}
		
		ta.push(t);
		ka.push(k);
		c=c+1;
		Z.push(c);
		
		if(t.x==k.x&&t.y==k.y){
			printf("%d\n",Z.back());
			break;
		}	
		
		
		
	}
	while(!ka.empty()){
	ka.pop();
	ta.pop();
	Z.pop();
	}
	c=0;
	l=-1;
	scanf("%d %d",&w,&h);
	}	
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'memset' was not declared in this scope
   24 |         memset(A,0,sizeof(A));
      |         ^~~~~~
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<stdio.h>
#include<iostream>
#include<queue>
using namespace std;
struct oza{
	int x;
	int y;
};
int A[52][52][52][52];
int main(){
	oza k;
	oza t;
	queue<oza> ka;
	queue<oza> ta;
	queue<int> Z;
	int  w,h,b;
	int d=0,c=0,i=0,j=0,l=-1,D[52][52];
	int tx[4]={ 1, 0,-1,0 };       
	int kx[4]={-1, 0, 1,0 };
	int ty[4]={ 0, 1, 0,-1 };
	int ky[4]={ 0, -1, 0,1};
	scanf("%d %d",&w,&h);
	while(w!=0&&h!=0){
	memset(A,0,sizeof(A));
		for(i=0;i<=h+1;i++){
		for(j=0;j<=w+1;j++){
		D[i][j]=1; //??¨????????????????????\?????? 
		}
	}

	scanf("%d %d",&t.x,&t.y);
	scanf("%d %d",&k.x,&k.y);
	for(i=1;i<=h;i++){
		for(j=1;j<=w;j++){
		scanf("%d",&D[i][j]);
		}
	}
	ta.push(t);
	ka.push(k);
	Z.push(c);
		if(t.x==k.x&&t.y==k.y){
			d=-1;
		}
	while(d!=-1){
		l++;
		if(l==4){
		l=0;
		t=ta.front();
		k=ka.front();
		ka.pop();
		ta.pop();
		Z.pop();
		A[t.x][t.y][k.x][k.y]=1;
		}
		if(c==100||Z.empty()){
			printf("NA");
		break;
		}
	
		// ?????\????????????????????¨?????¨??????
		t=ta.front();
		k=ka.front();
		c=Z.front();
		
		t.x=t.x+tx[l];
		t.y=t.y+ty[l];
		k.x=k.x+kx[l];
		k.y=k.y+ky[l];
		
		if(D[t.x][t.y]==1){
		t.x=t.x-tx[l];
		t.y=t.y-ty[l];
		}
		if(D[k.x][k.y]==1){
		k.x=k.x-kx[l];
		k.y=k.y-ky[l];
		}
		if(A[t.x][t.y][k.x][k.y]==1){
			continue;
		}
		
		ta.push(t);
		ka.push(k);
		c=c+1;
		Z.push(c);
		
		if(t.x==k.x&&t.y==k.y){
			printf("%d\n",Z.back());
			break;
		}	
		
		
	}
	while(!ka.empty()){
	ka.pop();
	ta.pop();
	Z.pop();
	}
	c=0;
	l=-1;
	scanf("%d %d",&w,&h);
	}	
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'memset' was not declared in this scope
   24 |         memset(A,0,sizeof(A));
      |         ^~~~~~
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<stdio.h>
#include<iostream>
#include<queue>
#include<string.h>
using namespace std;
struct oza{
	int x;
	int y;
};
int A[50][50][50][50];
int main(){
	oza k;
	oza t;
	queue<oza> ka;
	queue<oza> ta;
	queue<int> Z;
	int  w,h,b;
	int d=0,c=0,i=0,j=0,l=-1,D[52][52];
	int tx[4]={ 1, 0,-1,0 };       
	int kx[4]={-1, 0, 1,0 };
	int ty[4]={ 0, 1, 0,-1 };
	int ky[4]={ 0, -1, 0,1};
	scanf("%d %d",&w,&h);
	while(w!=0&&h!=0){
	memset(A,0,sizeof(A));
		for(i=0;i<=h+1;i++){
		for(j=0;j<=w+1;j++){
		D[i][j]=1; //??¨????????????????????\?????? 
		}
	}

	scanf("%d %d",&t.x,&t.y);
	scanf("%d %d",&k.x,&k.y);
	for(i=1;i<=h;i++){
		for(j=1;j<=w;j++){
		scanf("%d",&D[i][j]);
		}
	}
	ta.push(t);
	ka.push(k);
//	Z.push(c);
		if(t.x==k.x&&t.y==k.y){
			d=-1;
		}
	while(d!=-1){
		l++;
		if(l==4){
		l=0;
		t=ta.front();
		k=ka.front();
		ka.pop();
		ta.pop();
		Z.pop();
		A[t.x][t.y][k.x][k.y]=1;
		}
		//if(Z.back()==100||Z.empty()){
	//		printf("NA");
		//break;
		}
		t=ta.front();
		k=ka.front();
		c=Z.front();
		
		t.x=t.x+tx[l];
		t.y=t.y+ty[l];
		k.x=k.x+kx[l];
		k.y=k.y+ky[l];
		
		if(D[t.x][t.y]==1){
		t.x=t.x-tx[l];
		t.y=t.y-ty[l];
		}
		if(D[k.x][k.y]==1){
		k.x=k.x-kx[l];
		k.y=k.y-ky
			
			[l];
		}
		if(A[t.x][t.y][k.x][k.y]==1){
			continue;
		}
		
		ta.push(t);
		ka.push(k);
		c=c+1;
		Z.push(c);
		
		if(t.x==k.x&&t.y==k.y){
			printf("%d\n",Z.back());
			break;
		}	
		
		
	}
	while(!ka.empty()){
	ka.pop();
	ta.pop();
	//Z.pop();
	}
	c=0;
	l=-1;
	scanf("%d %d",&w,&h);
	}	
	return 0;

}

Compiler output:
a.cc:104:9: error: expected unqualified-id before 'return'
  104 |         return 0;
      |         ^~~~~~
a.cc:106:1: error: expected declaration before '}' token
  106 | }
      | ^