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

#include <map>
#include <cstdio>
using namespace std;
void solve(int T){
	map<pair<int,int>,int> m;
	char cmd[2];
	int n,k;
	for(;T--;){
		scanf("%s%d",cmd,&n);
		if(*cmd=='D'){
			for(auto it=m.begin();it!=m.end();)if(it->second==n)m.erase(it++);else	++it;
		}else if(*cmd=='R'){
			auto it=m.lower_bound(make_pair(n,2000000000));
			if(it==m.begin()){
				puts("-1");
			}else{
				printf("%d\n",--it->first.first<=n&&n<=it->first.second ? it->second : -1);
			}
		}else if(*cmd=='W'){
			int cur=0;
			scanf("%d",&k);
			for(auto it=m.begin();it!=m.end();++it){
				int d=it->first.first-cur;
				if(d>k)d=k;
				if(d)m[make_pair(cur,cur+d-1)]=n;
				k-=d;
				if(k==0)break;
				cur=it->first.second+1;
			}
			if(k)m[make_pair(cur,cur+k-1)]=n;
		}
	}
}
int main(){for(int T;~scanf("%d",&T)&&T;puts(""))solve(T);}

Compiler output:
a.cc: In function 'void solve(int)':
a.cc:17:59: error: decrement of member 'std::pair<int, int>::first' in read-only object
   17 |                                 printf("%d\n",--it->first.first<=n&&n<=it->first.second ? it->second : -1);
      |                                                 ~~~~~~~~~~^~~~~
Language: C++

#include <map>
#include <cstdio>
using namespace std;
int main(){for(int T;~scanf("%d",&T)&&T;puts("")){
	map<pair<int,int>,int>m;
	char C[2];
	int n,k;
	for(;T--;){
		scanf("%s%d",C,&n);
		if(*C=='D'){
			for(auto it=m.begin();it!=m.end();)if(it->second==n)m.erase(it++);else	++it;
		}else if(*C=='R'){
			auto it=m.lower_bound(make_pair(n,2000000000));
			printf("%d\n",it==m.begin()||n<(--it)->first.first||it->first.second<n ? -1 : it->second);
		}else if(*C=='W'){
			int c=0;
			scanf("%d",&k);
			for(auto it=m.begin();it!=m.end();++it){
				int d=it->first.first-cur;
				if(d>k)d=k;
				if(d)m[make_pair(c,c+d-1)]=n;
				k-=d;
				if(k==0)break;
				cur=it->first.second+1;
			}
			if(k)m[make_pair(c,c+k-1)]=n;
		}
	}
}}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:55: error: 'cur' was not declared in this scope
   19 |                                 int d=it->first.first-cur;
      |                                                       ^~~
Language: C++

#include<map>
#include<cstdio>
using namespace std;
int main(){for(int T;~scanf("%d",&T)&&T;puts("")){
	map<pair<int,int>,int>m;
	char C[2];
	int n,k;
	for(;T--;){
		scanf("%s%d",C,&n);
		if(*C=='D'){
			for(auto it=m.begin();it!=m.end();)if(it->second==n)m.erase(it++);else	++it;
		}else if(*C=='R'){
			auto it=m.lower_bound(make_pair(n,2000000000));
			printf("%d\n",it==m.begin()||n<(--it)->first.first||it->first.second<n ? -1 : it->second);
		}else if(*C=='W'){
			int c=!scanf("%d",&k),d;
			for(auto it=m.begin();k&&it!=m.end();++it){
				d=it->first.first-c;
				if(d>k)d=k;
				if(d)m.insert({{c,c+d-1},n});
				k-=d;
				c=it->first.second+1;
			}
			k&&m.insert({{c,c+k-1},n});
		}
	}
}}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:26: error: no match for 'operator&&' (operand types are 'int' and 'std::pair<std::_Rb_tree_iterator<std::pair<const std::pair<int, int>, int> >, bool>')
   24 |                         k&&m.insert({{c,c+k-1},n});
      |                         ~^~~~~~~~~~~~~~~~~~~~~~~~~
      |                         |          |
      |                         int        std::pair<std::_Rb_tree_iterator<std::pair<const std::pair<int, int>, int> >, bool>
a.cc:24:26: note: candidate: 'operator&&(bool, bool)' (built-in)
   24 |                         k&&m.insert({{c,c+k-1},n});
      |                         ~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:24:26: note:   no known conversion for argument 2 from 'std::pair<std::_Rb_tree_iterator<std::pair<const std::pair<int, int>, int> >, bool>' to 'bool'
Language: C++

#include<map>
#include<cstdio>
using namespace std;
int main(){for(int T;~scanf("%d",&T)&&T;puts("")){
	map<pair<int,int>,int>m;
	char C[2];
	int n,k;
	for(;T--;){
		scanf("%s%d",C,&n);
		if(*C=='D'){
			for(auto it=m.begin();it!=m.end();)if(it->second==n)m.erase(it++);else	++it;
		}else if(*C=='R'){
			auto it=m.lower_bound(make_pair(n,2000000000));
			printf("%d\n",it==m.begin()||n<(--it)->first.first||it->first.second<n ? -1 : it->second);
		}else if(*C=='W'){
			int c=!scanf("%d",&k),d;
			for(auto it=m.begin();k&&it!=m.end();++it){
				d=it->first.first-c;
				if(d>k)d=k;
				if(d)m.insert({{c,c+d-1},n});
				k-=d;
				c=it->first.second+1;
			}
			!!k&&m.insert({{c,c+k-1},n});
		}
	}
}}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:28: error: no match for 'operator&&' (operand types are 'bool' and 'std::pair<std::_Rb_tree_iterator<std::pair<const std::pair<int, int>, int> >, bool>')
   24 |                         !!k&&m.insert({{c,c+k-1},n});
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
      |                         |            |
      |                         bool         std::pair<std::_Rb_tree_iterator<std::pair<const std::pair<int, int>, int> >, bool>
a.cc:24:28: note: candidate: 'operator&&(bool, bool)' (built-in)
   24 |                         !!k&&m.insert({{c,c+k-1},n});
      |                         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:24:28: note:   no known conversion for argument 2 from 'std::pair<std::_Rb_tree_iterator<std::pair<const std::pair<int, int>, int> >, bool>' to 'bool'
Language: C++

#include<map>
#include<cstdio>
using namespace std;
int main(){for(int T;scanf("%d",&T),T;puts("")){
	map<pair<int,int>,int>m;
	char C[2];
	int n,k;
	for(;T--&&scanf("%s%d",C,&n);;){
		if(*C=='D'){
			for(auto it=m.begin();it!=m.end();)if(it->second==n)m.erase(it++);else ++it;
		}else if(*C=='R'){
			auto it=m.lower_bound(make_pair(n,2000000000));
			printf("%d\n",it==m.begin()||n<(--it)->first.first||it->first.second<n?-1:it->second);
		}else if(*C=='W'){
			int c=!scanf("%d",&k),d;
			for(auto it=m.begin();k&&it!=m.end();++it){
				d=it->first.first-c;
				if(d>k)d=k;
				if(d)m.insert({{c,c+d-1},n});
				k-=d;
				c=it->first.second+1;
			}
			if(k)m.insert({{c,c+k-1},n});
		}
	}
}}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:38: error: expected primary-expression before ';' token
    8 |         for(;T--&&scanf("%s%d",C,&n);;){
      |                                      ^
a.cc:8:38: error: expected ')' before ';' token
    8 |         for(;T--&&scanf("%s%d",C,&n);;){
      |            ~                         ^
      |                                      )
a.cc:8:39: error: expected primary-expression before ')' token
    8 |         for(;T--&&scanf("%s%d",C,&n);;){
      |                                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>

int main(){
    int n;
    while(cin >> n,n){
        
        // ?????????????????????????????±
        priority_queue<pii,vector<pii>,greater<pii>> pq;
        
        // ?????\??????????????????????´???????????????????
        map<int,vector<pii>> mp;
        
        // ??????????????????????????????->?????\??????
        map<int,int> endtoi;
        
        pq.push(make_pair(0, 1000000000));
        
        for(int i=0;i<n;i++){
            char c;cin >> c;
            if(c == 'W'){
                int i,s;
                cin >> i >> s;
                while(s > 0){
                    pii x = pq.top();
                    pq.pop();
                    if(s <= x.second - x.first){
                        pq.push(make_pair(x.first + s, x.second));
                        mp[i].push_back(make_pair(x.first, x.first + s));
                        endtoi[x.first + s] = i;
                        s = 0;
                    } else {
                        s -= x.second - x.first;
                        mp[i].push_back(make_pair(x.first, x.second));
                        endtoi[x.second] = i;
                    }
                }
            }
            if(c == 'D'){
                int i;
                cin >> i;
                for(int unsigned j = 0; j < mp[i].size(); j++){
                    pq.push(mp[i][j]);
                    endtoi.erase(mp[i][j].second);
                }
                mp.erase(i);
            }
            // ?????°???
            if(c == 'R'){
                int p;
                cin >> p;
                auto it = endtoi.lower_bound(p);
                if(it == m1.end()){
                    cout << -1 << endl;
                    continue;
                }
                int i = it->second;
                
                bool isInRange = false;
                for(int unsigned j = 0;j<mp[i].size();j++){
                	if(mp[i][j].first <= p && p <= mp[i][j].second){
                		isInRange = true;
                	}
                }
                if(isInRange){
                    cout << i << endl;
                } else {
                    cout << -1 << endl;
                }
            }
        }
        cout << endl;
    }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:26: error: 'm1' was not declared in this scope; did you mean 'mp'?
   54 |                 if(it == m1.end()){
      |                          ^~
      |                          mp
Language: C++

//25min
#include <iostream>
#include <vector>
using namespace std;

int main(){
  int N;
  while(cin >> N && N>0){
    vector<int> M;
    int max;
    for(int j=0;j<N;j++){
      char command;
      int i,s,p;
      cin >> command;
      switch(command){
      case 'W':
	cin >> i >> s;
	int index=0;
	while(s>0){
	  if(index>=M.size()){
	    M[index]=i;
	    s--;
	  }else if(M[index]==-1){
	    M[index]=i;
	    s--;
	  }
	  index++;
	}
	break;
      case 'D':
	cin >> i;
	for(int k=0;k<M.size();k++){
	  if(M[k]==i) M[k]=(-1);
	}
	break;
      case 'R':
	cin >> p;
	if(p<M.size()) cout << M[p] << endl;
	else cout << "-1" << endl;
	break;
      }
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:12: error: jump to case label
   30 |       case 'D':
      |            ^~~
a.cc:18:13: note:   crosses initialization of 'int index'
   18 |         int index=0;
      |             ^~~~~
a.cc:36:12: error: jump to case label
   36 |       case 'R':
      |            ^~~
a.cc:18:13: note:   crosses initialization of 'int index'
   18 |         int index=0;
      |             ^~~~~
Language: C++

//:55-
#include <iostream>
#include <utility>
#include <map>
using namespace std;

int main(){
  int N;
  while(cin >> N && N>0){
    map<pair<int,int>,int> files;
    for(int j=0;j<N;j++){
      char cmd;
      int I,S,P;
      int h=0, e;
      bool flg;
      cin >> cmd;

      map<pair<int,int>,int>::iterator f;
      switch(cmd){
      case 'W':
      cin >> I >> S;
      while(S>0){
	e=1000000000;
	for(f=files.begin();f!=files.end();++f){
	  if(f->first.first < e && f->first.first > h) e=f->first.first;
	}
	if(S>=h-e){
	  files[make_pair(h,e-1)]=I;
	  S-=h-e;
	}else{
	  files[make_pair(h,h+S)]=I;
	  S=0;
	}
	for(h=e+1;;h++){
	  flg=true;
	  for(f=files.begin();f!=files.end();++f){
	    if(f->first.first<=h && h<=f->first.second){
	      flg=(f->second==-1);
	      break;
	    }
	  }
	  if(flg) break;
	}
      }
      break;
      case 'D':
	cin >> I;
	for(f=files.begin();f!=files.end();++f){
	  if(f->second==I) f->second=-1;
	  if(h>f->first.first) h=f->first.first;
	}
	break;
      case 'R':
	cin >> P;
	for(f=files.begin();f!=files.end();++f){
	  if(P>=f->first.first && P<=f->first.second){
	    cout << f->second << endl;
	    break;
	  }
	}
	If(f==files.end()) cout << -1 << endl;
	break;
      }
    }
    cout << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:9: error: 'If' was not declared in this scope; did you mean 'f'?
   61 |         If(f==files.end()) cout << -1 << endl;
      |         ^~
      |         f
Language: C++

import java.util.*;

public class Main
{

  

    public static void main(String args[])
    {
	Scanner in = new Scanner(System.in);
	int N;
	while(true)
	    {
		N = in.nextInt();
		if(N == 0)break;
		LinkedList<P> list = new LinkedList<P>();
		list.add(new P(0,0,-1));

		String c;
		int I,S;
		for(int i=0;i<N;i++)
		    {
			c = in.next();
			if(c.equals("W"))
			    {
				I = in.nextInt();
				S = in.nextInt();
				for(int j=0;j<list.size()-1;j++)
				    {	
					int v1 = list.get(j).r;
					int v2 = list.get(j+1).l;
					if(v1 == v2)continue;
					//System.out.println("add ! " + j + " " + v1 + " " + v2);
					list.add(j+1,new P(v1,Math.min((v2-v1)+v1,v1+S),I) ); 
					S -= (v2-v1);
					if(S < 0)S = 0;

					if(S == 0)break;
				    }
				if(S != 0)
				    {

						int lass = (list.size()-1 >= 0?list.get(list.size()-1).r:0);
						list.add(new P(lass,lass+S,I));

				    }
					
			    }
			else if(c.equals("D"))
			    {
				I = in.nextInt();
				for(int j=1;j<list.size();j++)
				    {
					int v = list.get(j).id;
					if(v == I)
					    {
						P p = list.remove(j);
					    }
				    }
			    }
			else
			    {
				I = in.nextInt();
				boolean found = false;
				for(int j=1;j<list.size();j++)
				    {
					P p = list.get(j);
					if(p.l <= I && I < p.r)
					    {
						found = true;
						System.out.println(p.id);
						break;
					    }
				    }
				if(!found)System.out.println(-1);
			    }
			/*
			System.out.println("------------");
			for(int j=0;j<list.size();j++)
			    {
				System.out.println(list.get(j).l + " - " +list.get(j).r + " : " + list.get(j).id);
			    }
			System.out.println("------------");
			*/
		    }
	    }
    }
}

class P
{
    public int r,l,id;
    P(int rl,int rr,int rid)
    {
	r = rr;
	l = rl;
	id = rid;
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main
      | ^~~~~~
a.cc:92:11: error: expected ':' before 'int'
   92 |     public int r,l,id;
      |           ^~~~
      |           :
a.cc:99:2: error: expected ';' after class definition
   99 | }
      |  ^
      |  ;
Language: C++

#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <valarray>
#include <iterator>
using namespace std;
typedef long long int lli;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<pii, int> ppiii;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RREP(i,x) for(int i=(x);i>=0;i--)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) container.begin(), container.end()
#define SZ(container) ((int)container.size())

const int INF = 1<<28;
const double EPS = 1e-8;
const int MOD = 1000000007;


int n;

vector<ppiii> seg;
priority_queue<pii, vector<pii>, greater<pii> > del;
main(){
	int i,j;
	while(scanf("%d", &n), n){
		seg.clear();
		del.clear();
		int back = 0;
		int sorted = 1;
		REP(i, n){
			char c;
			int id, len;
			scanf(" %c%d", &c, &id);
//			cerr << c << ", " << id << endl;
			if(c == 'W'){
				scanf("%d", &len);
				while(!del.empty()){
					pii s = del.top();
					del.pop();
					int l = min(len, s.second);
					len -= l;
					s.second -= l;
					seg.push_back(ppiii(pii(s.first, l), id));
					sorted = 0;
					if(s.second) del.push(s);
				}
				if(len){
					seg.push_back(ppiii(pii(back, len), id));
					back += len;
				}
			}else if(c == 'R'){
				if(seg.size() == 0) puts("-1");
				else{
					if(!sorted) sort(seg.begin(), seg.end());
					auto it = lower_bound(seg.begin(), seg.end(), ppiii(pii(id+1, 0), 0));
					--it;
					if(it->first.first <= id && it->first.first + it->first.second >= id) printf("%d\n", it->second);
					else puts("-1");
				}
			}else if(c == 'D'){
				int t = 0;
				int s = 0;
				for(;s<seg.size();s++){
					if(seg[s].second == id){
						del.push(seg[s].first);
					}else{
						seg[t] = seg[s];
						t ++;
					}
				}
			}
		}
		puts("");
	}
	return 0;
}

Compiler output:
a.cc:48:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   48 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:52:21: error: 'class std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::greater<std::pair<int, int> > >' has no member named 'clear'
   52 |                 del.clear();
      |                     ^~~~~
Language: C++

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

using namespace std;
int const dxL[] = {-1,0,1,0};
int const dxR[] = {1,0,-1,0};
int const dy[]  = {0,-1,0,1};
typedef pair<int, int> Pii;
#define X first
#define Y second
int const INF = 1<<28;
int W, H;
char grL[51][51], grR[51][51];
bool used[2500][2500];
inline bool isValid(int x, int y) {
  if(0<=x&&x<W && 0<=y&&y<H) return true;
  return false;
}

inline bool inF(int x, int y, int isL) {
  if(isL) return grL[y][x]!='#';
  return grR[y][x]!='#';
}
inline int toNode(int x, int y) {
  return y*W+x;
}
inline void toPos(int node, int &x, int &y) {
  x = node%W, y = node/W;
}
int main() {
  
  while(cin >> W >> H && (W|H)) {
    int sxL, syL, sxR, syR;
    int gxL, gyL, gxR, gyR;
    for(int i=0; i<H; i++) {
      for(int j=0; j<2*W; j++) {
        if(j<W) {
          cin >> grL[i][j];
          if(grL[i][j] == 'L') {
            sxL = j, syL = i;
          }
          if(grL[i][j] == '%') {
            gxL = j, gyL = i;
          }
        }
        else {
          cin >> grR[i][j-W];
          if(grR[i][j-W] == 'R') {
            sxR = j-W, syR = i;
          }
          if(grR[i][j-W] == '%') {
            gxR = j-W, gyR = i;
          }
        }
      }
    }
    
    queue<int> qL, qR;
    qL.push(toNode(sxL, syL)); qR.push(toNode(sxR, syR));
    bool ok = false;
    memset(used, false, sizeof used);
    while(!qL.empty()) {
      const int nowL = qL.front(); qL.pop();
      const int nowR = qR.front(); qR.pop();
      int lx, ly; toPos(nowL, lx, ly);
      int rx, ry; toPos(nowR, rx, ry);

      if(lx == gxL && ly == gyL && rx == gxR && ry == gyR) {
        ok = true; break;
      }
      if(lx == gxL && ly == gyL) {
        continue;
      }
      if(rx == gxR && ry == gyR) {
        continue;
      }
      for(int i=0; i<4; i++) {
        int nxL = lx+dxL[i], nyL = ly+dy[i];
        int nxR = rx+dxR[i], nyR = ry+dy[i];

        if((!isValid(nxL, nyL)) || (!isValid(nxR, nyR))) continue;

        if((!inF(nxL, nyL, 1)) && (!inF(nxR, nyR, 0))) continue;
        if(!inF(nxL, nyL, 1)) { nxL = lx, nyL = ly; }
        if(!inF(nxR, nyR, 0)) { nxR = rx, nyR = ry; }
        if(used[toNode(nxL, nyL)][toNode(nxR, nyR)]) continue;
        qL.push(toNode(nxL, nyL));
        qR.push(toNode(nxR, nyR));
        used[toNode(nxL, nyL)][toNode(nxR, nyR)] = true;
      }
    }
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  
  return 0;
}

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

#include<iostream>
#include<queue>
#include<algorithm>
using namespace std;
typedef pair< int, int > Pi;

bool used[50][50][50][50];
char masL[50][50], masR[50][50];
int W, H;
Pi RinS, LenS; //スタート
const int dy[] = { 1, 0, -1, 0}, dx[] = { 0, 1, 0, -1};

bool isover(int y, int x){
  return y < 0 || y >= H || x < 0 || x >= W;
}

int bfs(){
  queue< Pi > Rin, Len;
  Rin.push(RinS);
  Len.push(LenS);
  used[RinS.first][RinS.second][LenS.first][LenS.second] = true;
  while(!Rin.empty()){
    Pi r = Rin.front(), l = Len.front();
    Rin.pop(), Len.pop();
    if(masL[l.first][l.second] == '%' && masR[r.first][r.second] == '%'){
      return true;
    }
    if(masL[l.first][l.second] != '%' && masR[r.first][r.second] != '%'){
      for(int i = 0; i < 4; i++){
        int rny = min( H - 1, max( 0, r.first + dy[i]));
        int rnx = min( W - 1, max( 0, r.second + dx[i]));
        int lny = min( H - 1, max( 0, l.first + dy[i]));
        int lnx = min( W - 1, max( 0, r.second - dx[i]));
        //めんどい
        if(masR[lny][lnx] == '#'){ //元の位置に戻す！！
          lny = l.first, lnx = l.second;
        }
        if(masL[rny][rnx] == '#'){
          rny = r.first, rnx = r.second;
        }
        
        if(!used[rny][rnx][lny][lnx]){
          used[rny][rnx][lny][lnx] = true;
          Rin.push( Pi( rny, rnx)), Len.push( Pi( lny, lnx));
        }
      }
    }
  }
  return false; //いけない!!
}
int main()
{
  while(cin >> W >> H, W){
    memset( used, false, sizeof(used));
    for(int i = 0; i < H; i++){
      for(int j = 0; j < W; j++){
        cin >> masL[i][j];
        if(masL[i][j] == 'L'){
          LenS = Pi( i, j);
          masL[i][j] = '.';
        }
      }
      for(int j = 0; j < W; j++){
        cin >> masR[i][j];
        if(masR[i][j] == 'R'){
          RinS = Pi( i, j);
          masR[i][j] = '.';
        }
      }
    }
    bool judge = bfs();
    if(!judge) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
}

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

#include <queue>
#include <tuple>
#include <string>
#include <iostream>

using namespace std;

const int dx1[4] = { 0, 1, 0, -1 };
const int dy1[4] = { -1, 0, 1, 0 };
const int dx2[4] = { 0, -1, 0, 1 };
const int dy2[4] = { -1, 0, 1, 0 };

int H, W; string L[50], R[50];

bool used[50][50][50][50];

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

bool solve(int lx, int ly, int rx, int ry)
{
	used[ly][lx][ry][rx] = true;

	if (L[ly][lx] == '%' && R[ry][rx] == '%') return true;

	if (L[ly][lx] == '%') return false;
	if (R[ry][rx] == '%') return false;

	bool ok = false;

	for (int i = 0; i < 4; i++)
	{
		int ltx = lx + dx1[i];
		int lty = ly + dy1[i];
		int rtx = rx + dx2[i];
		int rty = ry + dx2[i];

		if (!over(ltx, lty) && !over(rtx, rty))
		{
			if (L[lty][ltx] != '#' && R[rty][rtx] != '#')
			{
				if (!used[lty][ltx][rty][rtx])
				{
					ok |= solve(ltx, lty, rtx, rty);
				}
			}
		}
	}

	return ok;
}

int main()
{
	while (true)
	{
		scanf("%d", &W);
		scanf("%d", &H);

		for (int i = 0; i < H; i++) cin >> L[i] >> R[i];

		int lx, ly, rx, ry;

		for (int i = 0; i < H; i++)
		{
			for (int j = 0; j < W; j++)
			{
				if (L[i][j] == 'L')
				{
					lx = j;
					ly = i;
				}

				if (R[i][j] == 'R')
				{
					rx = j;
					ry = i;
				}
			}
		}

		memset(used, false, sizeof(used));

		printf("%s\n", solve(lx, ly, rx, ry) ? "Yes" : "No");
	}

	return 0;
}

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

/*** ???????????? ***/

#include <bits/stdc++.h>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)

struct State{
	int xL, yL, xR, yR;
};

int main(){
	int w, h;
	
	int dx[4]={0, 1, 0, -1}; // ????????????
	int dy[4]={-1, 0, 1, 0};
	
	while(cin>>w>>h, w||h){
		State st;
		char Len[51][51];
		char Rin[51][51];
		bool hist[51][51][51][51]={false};
		
		REP(i, 0, h){
			REP(j, 0, w){
				cin >> Len[i][j];
				if(Len[i][j]=='L'){
					st.yL=i;
					st.xL=j;
				}
			}
			REP(j, 0, w){
				cin >> Rin[i][j];
				if(Rin[i][j]=='R'){
					st.yR=i;
					st.xR=j;
				}
			}
		}
		
		queue<State> qu;
		qu.push(st);
		hist[st.yL][st.xL][st.yR][st.xR]=true;
		bool flag=false;
		
		while(!qu.empty()){
			//pair<int, int> q=qu.front();
			State q=qu.front();
			qu.pop();
			
			int yl=q.yL, xl=q.xL, yr=q.yR, xr=q.xR;
			if(Lin[yl][xl]=='%' && Ren[yr][xr]=='%'){
				flag=true;
				break;
			}
			for(int k=0; k<4; ++k){
				int yyl=yl+dy[k], xxl=xl+dx[k];
				int yyr=yyl, xxr=xxl;
				if(k%2==1){
					yyr=yr+dy[k]*(-1);
					xxr=xr+dx[k]*(-1);
				}
				
				if(yyl<0 || yyl>=h || xxl<0 || xxl>=w || Lin[yyl][xxl]=='#'){
					yyl=yl;
					xxl=xl;
				}
				if(yyr<0 || yyr>=h || xxr<0 || xxr>=w || Ren[yyr][xxr]=='#'){
					yyr=yr;
					xxr=xr;
				}
				if(hist[yyl][xxl][yyr][xxr]) continue;
				hist[yyl][xxl][yyr][xxr]=true;
				qu.push({yyl, xxl, yyr, xxr});
			}
		}
		if(flag) cout << "Yes" << endl;
		else cout << "No" << endl;
		
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:28: error: 'Lin' was not declared in this scope; did you mean 'Rin'?
   51 |                         if(Lin[yl][xl]=='%' && Ren[yr][xr]=='%'){
      |                            ^~~
      |                            Rin
a.cc:51:48: error: 'Ren' was not declared in this scope; did you mean 'Rin'?
   51 |                         if(Lin[yl][xl]=='%' && Ren[yr][xr]=='%'){
      |                                                ^~~
      |                                                Rin
a.cc:63:74: error: 'Lin' was not declared in this scope; did you mean 'Rin'?
   63 |                                 if(yyl<0 || yyl>=h || xxl<0 || xxl>=w || Lin[yyl][xxl]=='#'){
      |                                                                          ^~~
      |                                                                          Rin
a.cc:67:74: error: 'Ren' was not declared in this scope; did you mean 'Rin'?
   67 |                                 if(yyr<0 || yyr>=h || xxr<0 || xxr>=w || Ren[yyr][xxr]=='#'){
      |                                                                          ^~~
      |                                                                          Rin
Language: C++

// SampleMC1.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

#include "stdafx.h"
#include<iostream>
#include<queue>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)

bool hist[51][51][51][51];

struct State {
	int xL, yL, xR, yR;
};

int main() {
	int w, h;

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

	while (cin >> w >> h, w || h) {
		State st;
		char Len[51][51];
		char Rin[51][51];
		//bool hist[51][51][51][51] = { false };
		hist[51][51][51][51] = { false };

		/* crate maze */
		REP(i, 0, h) {
			REP(j, 0, w) {
				cin >> Len[i][j];
				if (Len[i][j] == 'L') {
					st.yL = i;
					st.xL = j;
				}
			}
			REP(j, 0, w) {
				cin >> Rin[i][j];
				if (Rin[i][j] == 'R') {
					st.yR = i;
					st.xR = j;
				}
			}
		}

		/* BFS */
		queue<State> qu;
		qu.push(st);
		hist[st.yL][st.xL][st.yR][st.xR] = true;
		bool flag = false;

		while (!qu.empty()) {
			State q = qu.front();
			qu.pop();

			int yl = q.yL, xl = q.xL, yr = q.yR, xr = q.xR;
			if (Len[yl][xl] == '%' && Rin[yr][xr] == '%') {
				flag = true;
				break;
			}
			else if (Len[yl][xl] == '%' || Rin[yr][xr] == '%') continue;
			for (int k = 0; k<4; ++k) {
				int yyl = yl + dy[k], xxl = xl + dx[k];
				int yyr, xxr;
				yyr = yr + dy[k];
				xxr = xr + dx[k] * (-1);

				if (yyl<0 || yyl >= h || xxl<0 || xxl >= w || Len[yyl][xxl] == '#') {
					yyl = yl;
					xxl = xl;
				}
				if (yyr<0 || yyr >= h || xxr<0 || xxr >= w || Rin[yyr][xxr] == '#') {
					yyr = yr;
					xxr = xr;
				}
				if (hist[yyl][xxl][yyr][xxr]) continue;
				hist[yyl][xxl][yyr][xxr] = true;
				qu.push({ yyl, xxl, yyr, xxr });
				//cout << yyl << " " << xxl << " " << yyr << " " << xxr << endl;
			}
		}
		if (flag) cout << "Yes" << endl;
		else cout << "No" << endl;

	}
	int in;
	cin >> in;
	return 0;
}

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

#include<iostream>
#include<queue>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)

bool hist[51][51][51][51];

struct State {
	int xL, yL, xR, yR;
};

int main() {
	int w, h;

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

	while (cin >> w >> h, w || h) {
		State st;
		char Len[51][51];
		char Rin[51][51];
		//bool hist[51][51][51][51] = { false };
		//hist[51][51][51][51] = { false };
		memset(hist, false, sizeof hist);

		/* crate maze */
		REP(i, 0, h) {
			REP(j, 0, w) {
				cin >> Len[i][j];
				if (Len[i][j] == 'L') {
					st.yL = i;
					st.xL = j;
				}
			}
			REP(j, 0, w) {
				cin >> Rin[i][j];
				if (Rin[i][j] == 'R') {
					st.yR = i;
					st.xR = j;
				}
			}
		}

		/* BFS */
		queue<State> qu;
		qu.push(st);
		hist[st.yL][st.xL][st.yR][st.xR] = true;
		//cout << st.yL << " " << st.xL << " " << st.yR << " " << st.xR << endl;
		bool flag = false;

		while (!qu.empty()) {
			State q = qu.front();
			qu.pop();

			int yl = q.yL, xl = q.xL, yr = q.yR, xr = q.xR;
			if (Len[yl][xl] == '%' && Rin[yr][xr] == '%') {
				flag = true;
				break;
			}
			else if (Len[yl][xl] == '%' || Rin[yr][xr] == '%') continue;
			for (int k = 0; k<4; ++k) {
				int yyl = yl + dy[k], xxl = xl + dx[k];
				int yyr, xxr;
				yyr = yr + dy[k];
				xxr = xr + dx[k] * (-1);

				if (yyl<0 || yyl >= h || xxl<0 || xxl >= w) {
					yyl = yl;
					xxl = xl;
				}
				else if (Len[yyl][xxl] == '#') {
					yyl = yl;
					xxl = xl;
				}
				
				if (yyr<0 || yyr >= h || xxr<0 || xxr >= w) {
					yyr = yr;
					xxr = xr;
				}
				else if (Rin[yyr][xxr] == '#') {
					yyr = yr;
					xxr = xr;
				}
				if (hist[yyl][xxl][yyr][xxr]) continue;
				hist[yyl][xxl][yyr][xxr] = true;
				qu.push({ yyl, xxl, yyr, xxr });
				//cout << yyl << " " << xxl << " " << yyr << " " << xxr << endl;
			}
		}
		if (flag) cout << "Yes" << endl;
		else cout << "No" << endl;
		/*
		REP(i, 0, h) {
			REP(j, 0, w) {
				cout << Len[i][j];
			}
			cout << " ";
			REP(j, 0, w) {
				cout << Rin[i][j];
			}
			cout << endl;
		}*/

	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'memset' was not declared in this scope
   24 |                 memset(hist, false, sizeof hist);
      |                 ^~~~~~
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++

// SampleMC1.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

#include "stdafx.h"
#include<iostream>
#include<queue>
#include<stack>
#include<string.h>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)

bool hist[51][51][51][51];

struct State {
	int xL, yL, xR, yR;
};

int main() {
	int w, h;

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

	while (cin >> w >> h, w || h) {
		State st;
		char Len[51][51];
		char Rin[51][51];
		//bool hist[51][51][51][51] = { false };
		//hist[51][51][51][51] = { false };
		memset(hist, false, sizeof hist);

		/* crate maze */
		REP(i, 0, h) {
			REP(j, 0, w) {
				cin >> Len[i][j];
				if (Len[i][j] == 'L') {
					st.yL = i;
					st.xL = j;
				}
			}
			REP(j, 0, w) {
				cin >> Rin[i][j];
				if (Rin[i][j] == 'R') {
					st.yR = i;
					st.xR = j;
				}
			}
		}

		/* BFS */
		stack<State> stk;
		stk.push(st);
		
		hist[st.yL][st.xL][st.yR][st.xR] = true;
		bool flag = {};

		while (!stk.empty()) {
			//State q = qu.front();
			//qu.pop();
			State sk = stk.top();
			stk.pop();

			int yl = sk.yL, xl = sk.xL, yr = sk.yR, xr = sk.xR;
			if (Len[yl][xl] == '%' && Rin[yr][xr] == '%') {
				flag = true;
				break;
			}
			else if (Len[yl][xl] == '%' || Rin[yr][xr] == '%') continue;
			for (int k = 0; k<4; ++k) {
				int yyl = yl + dy[k], xxl = xl + dx[k];
				int yyr, xxr;
				yyr = yr + dy[k];
				xxr = xr + dx[k] * (-1);

				if (yyl<0 || yyl >= h || xxl<0 || xxl >= w) {
					yyl = yl;
					xxl = xl;
				}
				else if (Len[yyl][xxl] == '#') {
					yyl = yl;
					xxl = xl;
				}
				
				if (yyr<0 || yyr >= h || xxr<0 || xxr >= w) {
					yyr = yr;
					xxr = xr;
				}
				else if (Rin[yyr][xxr] == '#') {
					yyr = yr;
					xxr = xr;
				}
				if (hist[yyl][xxl][yyr][xxr]) continue;
				hist[yyl][xxl][yyr][xxr] = true;
				stk.push({ yyl, xxl, yyr, xxr });
				//cout << yyl << " " << xxl << " " << yyr << " " << xxr << endl;
			}
		}
		if (flag) cout << "Yes" << endl;
		else cout << "No" << endl;

	}
	
	return 0;
}

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

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define mk make_pair
using namespace std;
string s1[50],s2[50];
int dx1[]={1,-1,0,0,},dy1[]={0,0,1,-1};
int dx2[]={-1,1,0,0,},dy2[]={0,0,1,-1};
int w,h,gx1,gx2,gy1,gy2;
unordered_set<int>s;
bool bfs(int x1,int y1,int x2,int y2){
  queue<int>q;
  q.push(x1+y1*100+x2*10000+y2*1000000);
  while(!q.empty()){
    int p=q.front();q.pop();
    x1=p%100;y1=p%10000/100;
    x2=p%1000000/10000;y2=p/1000000;
    if(x1==gx1&&y1==gy1&&x2==gx2&&y2==gy2){
      return 1;
    }
    for(int i=0;i<4;i++){
      int x3=x1+dx1[i],y3=y1+dy1[i];
      int x4=x2+dx2[i],y4=y2+dy2[i];
      if(x3>=0&&x4>=0&&y3>=0&&y4>=0)
        if(x3<w&&x4<w&&y3<h&&y4<h){
          if(s1[y3][x3]=='#')y3=y1,x3=x1;
          if(s2[y4][x4]=='#')y4=y2,x4=x2;
          if(!(x3==gx1&&y3==gy1&&(x4!=gx2||y4!=gy2)))
          if(!((x3!=gx1||y3!=gy1)&&x4==gx2&&y4==gy42))
          if(!s.count(x3+y3*100+x4*10000+y4*1000000)){
            s.insert(x3+y3*100+x4*10000+y4*1000000);
            q.push(x3+y3*100+x4*10000+y4*1000000);
          }
        }
      }
    }
    return 0;
}
int main(){
  int x1,y1,x2,y2;
  while(cin>>w>>h,w){
    s.clear();
    r(i,h)cin>>s1[i]>>s2[i];
    r(i,h)r(j,w){
      if(s1[i][j]=='L')x1=j,y1=i;
      if(s2[i][j]=='R')x2=j,y2=i;
      if(s1[i][j]=='%')gx1=j,gy1=i;
      if(s2[i][j]=='%')gx2=j,gy2=i;
    }
    s.insert(x1+y1*100+x2*10000+y2*1000000);
    if(bfs(x1,y1,x2,y2))cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
}

Compiler output:
a.cc: In function 'bool bfs(int, int, int, int)':
a.cc:28:49: error: 'gy42' was not declared in this scope; did you mean 'gy2'?
   28 |           if(!((x3!=gx1||y3!=gy1)&&x4==gx2&&y4==gy42))
      |                                                 ^~~~
      |                                                 gy2
Language: C++

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


using namespace std;

char fieldL[51][51];
char fieldR[51][51];
bool checked[51][51][51][51];

int w, h;

bool dfs(int ly, int lx, int ry, int rx) {
  if (fieldL[ly][lx] == fieldR[ry][rx] && fieldL[ly][lx] == '%') {
    return true;
  }
  if (checked[ly][lx][ry][rx]) {
    return false;
  }
  
  checked[ly][lx][ry][rx] = true;

  int dyL[] = { -1, 0, 1, 0 };
  int dxL[] = { 0, 1, 0, -1 };
  int dyR[] = { -1, 0, 1, 0 };
  int dxR[] = { 0, -1, 0, 1 };


  bool ret = false;
  for (int i = 0; i < 4; i++) {
    int nly = ly + dyL[i];
    int nlx = lx + dxL[i];
    int nry = ry + dyR[i];
    int nrx = rx + dxR[i];
    if (nly < 0) nly = 0;
    if (nly >= h) nly = h - 1;
    if (nlx < 0) nlx = 0;
    if (nlx >= w) nlx = w - 1;
    if (nry < 0) nry = 0;
    if (nry >= h) nry = h - 1;
    if (nrx < 0) nrx = 0;
    if (nrx >= w) nrx = w - 1;
    if (fieldL[nly][nlx] == '#') {
      nly = ly; nlx = lx;
    }
    if (fieldR[nry][nrx] == '#') {
      nry = ry; nrx = rx;
    }
    ret |= dfs(nly, nlx, nry, nrx);
  }

  return ret;
}

int main() {
  while (true) {
    cin >> w >> h;
    if (w + h == 0) {
      break;
    }
    int ly, lx, ry, rx;
    for (int i = 0; i < h; i++) {
      string strL, strR;
      cin >> strL >> strR;
      for (int j = 0; j < w; j++) {
        fieldL[i][j] = strL[j];
        fieldR[i][j] = strR[j];
        if (strL[j] == 'L') {
          ly = i; lx = j;
        }
        if (strR[j] == 'R') {
          ry = i; rx = j;
        }
      }
    }

    memset(checked, false, sizeof(checked));

    if (dfs(ly, lx, ry, rx)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }


  return 0;
}

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

#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <queue>
#include <array>
#include <stack>

enum PassageType{
	FREE, WALL, SEARCHED, GOAL,
};

bool isSearched[50][50][50][50] = {false};

struct Point {
	Point() { x = 0; y = 0; };
	Point(int x, int y) {
		this->x = x;
		this->y = y;
	};
	int x, y;
};

int main() {
	int w, h;

	while (std::cin >> w >> h && w && h) {
		memset(isSearched, false, sizeof(bool) * 50 * 50 * 50 * 50);
		std::array<std::vector<std::vector<int>>, 2> room;
		Point start[2];
		for (int i = 0; i < h; i++) {
			std::array<std::string, 2> str;
			for (int j = 0; j < str.size(); j++) {
				std::cin >> str[j];
				room[j].push_back(std::vector<int>());
				for (int k = 0; k < str[j].size(); k++) {
					int type = 0;
					if (str[j][k] == '.') type = FREE;
					else if (str[j][k] == '#') type = WALL;
					else if (str[j][k] == '%') type = GOAL;
					else if (str[j][k] == 'L' || str[j][k] == 'R') {
						start[j].x = k;
						start[j].y = i;
						type = SEARCHED;
					}
					room[j].back().push_back(type);
				}
			}
		}

		std::stack<std::pair<Point, Point>> s;
		s.push(std::make_pair(start[0], start[1]));
		int dx[] = {1, 0, -1, 0};
		int dy[] = {0, 1, 0, -1};

		bool isOk = false;
		while (!s.empty() && !isOk) {
			auto node = s.top(); s.pop();

			//?¬???????????????´????????¢???
			for (int i = 0; i < 4; i++) {
				auto next = node;
				next.first.x += dx[i];
				next.first.y += dy[i];
				next.second.x -= dx[i];
				next.second.y += dy[i];

				//??´????£???£
				next.first.x = std::min(std::max(0, next.first.x), w - 1);
				next.first.y = std::min(std::max(0, next.first.y), h - 1);
				next.second.x = std::min(std::max(0, next.second.x), w - 1);
				next.second.y = std::min(std::max(0, next.second.y), h - 1);

				//??????????????´????????????OK
				if (room[0][next.first.y][next.first.x] == GOAL && room[1][next.second.y][next.second.x] == GOAL) {
					isOk = true;
				}
				else {
					int r[2] = {room[0][next.first.y][next.first.x], room[1][next.second.y][next.second.x] };
					//?£???????????????????????????????
					if (room[0][next.first.y][next.first.x] == WALL) {
						next.first = node.first;
					}
					if (room[1][next.second.y][next.second.x] == WALL) {
						next.second = node.second;
					}
					if (!isSearched[next.first.y][next.first.x][next.second.y][next.second.x]) {
						s.push(next);
						isSearched[next.first.y][next.first.x][next.second.y][next.second.x] = true;
					}
				}
			}
		}

		std::cout << (isOk ? "Yes" : "No") << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'memset' was not declared in this scope
   28 |                 memset(isSearched, false, sizeof(bool) * 50 * 50 * 50 * 50);
      |                 ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <stack>
  +++ |+#include <cstring>
    8 |
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <queue>
#include <array>
#include <stack>

enum PassageType{
	FREE, WALL, SEARCHED, GOAL,
};

bool isSearched[50][50][50][50] = {false};

struct Point {
	Point() { x = 0; y = 0; };
	Point(int x, int y) {
		this->x = x;
		this->y = y;
	};
	int x, y;
};

int main() {
	int w, h;

	while (std::cin >> w >> h && w && h) {
		std::memset(isSearched, false, sizeof(bool) * 50 * 50 * 50 * 50);
		std::array<std::vector<std::vector<int>>, 2> room;
		Point start[2];
		for (int i = 0; i < h; i++) {
			std::array<std::string, 2> str;
			for (int j = 0; j < str.size(); j++) {
				std::cin >> str[j];
				room[j].push_back(std::vector<int>());
				for (int k = 0; k < str[j].size(); k++) {
					int type = 0;
					if (str[j][k] == '.') type = FREE;
					else if (str[j][k] == '#') type = WALL;
					else if (str[j][k] == '%') type = GOAL;
					else if (str[j][k] == 'L' || str[j][k] == 'R') {
						start[j].x = k;
						start[j].y = i;
						type = SEARCHED;
					}
					room[j].back().push_back(type);
				}
			}
		}

		std::stack<std::pair<Point, Point>> s;
		s.push(std::make_pair(start[0], start[1]));
		int dx[] = {1, 0, -1, 0};
		int dy[] = {0, 1, 0, -1};

		bool isOk = false;
		while (!s.empty() && !isOk) {
			auto node = s.top(); s.pop();

			//?¬???????????????´????????¢???
			for (int i = 0; i < 4; i++) {
				auto next = node;
				next.first.x += dx[i];
				next.first.y += dy[i];
				next.second.x -= dx[i];
				next.second.y += dy[i];

				//??´????£???£
				next.first.x = std::min(std::max(0, next.first.x), w - 1);
				next.first.y = std::min(std::max(0, next.first.y), h - 1);
				next.second.x = std::min(std::max(0, next.second.x), w - 1);
				next.second.y = std::min(std::max(0, next.second.y), h - 1);

				//??????????????´????????????OK
				if (room[0][next.first.y][next.first.x] == GOAL && room[1][next.second.y][next.second.x] == GOAL) {
					isOk = true;
				}
				else {
					int r[2] = {room[0][next.first.y][next.first.x], room[1][next.second.y][next.second.x] };
					//?£???????????????????????????????
					if (room[0][next.first.y][next.first.x] == WALL) {
						next.first = node.first;
					}
					if (room[1][next.second.y][next.second.x] == WALL) {
						next.second = node.second;
					}
					if (!isSearched[next.first.y][next.first.x][next.second.y][next.second.x]) {
						s.push(next);
						isSearched[next.first.y][next.first.x][next.second.y][next.second.x] = true;
					}
				}
			}
		}

		std::cout << (isOk ? "Yes" : "No") << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:22: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
   28 |                 std::memset(isSearched, false, sizeof(bool) * 50 * 50 * 50 * 50);
      |                      ^~~~~~
      |                      wmemset
Language: C++

from collections import deque
while True:
    w,h=map(int,input().split(" "))
    def isrange(p):
        return 0<=p[0] and p[0]<h and 0<=p[1] and p[1]<w
    if w==0: break
    rl=[[str()] for i in range(h)]
    rr=[[str()] for i in range(h)]
    for i in range(h):
        rl[i],rr[i]=input().split(" ")
    q = deque()
    s=set()
    for i in range(h):
        for j in range(w):
            if rl[i][j]=="L": ls=(i,j)
            if rr[i][j]=="R": rs=(i,j)
            if rl[i][j]=="%": gl=(i,j)
            if rr[i][j]=="%": gr=(i,j)
    q.append((ls,rs))
    dw=(-1,0,1,0)
    dh=(0,1,0,-1)
    while q:
        val=q.pop()
        if val in s: continue
        s.add(val)
        lp=val[0]
        rp=val[1]
        for i in range(4):
            lnp=(lp[0]+dh[i],lp[1]+dw[i])
            rnp=(rp[0]+dh[i],rp[1]-dw[i])
            if (not isrange(lnp)) or rl[lnp[0]][lnp[1]]=="#" : lnp=lp
            if (not isrange(rnp)) or rr[rnp[0]][rnp[1]]=="#" : rnp=rp
            q.append((lnp,rnp))
    if (gl,gr) in s : print("Yes")
    else : print("No")

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import deque
      | ^~~~
Language: Java

import com.sun.xml.internal.bind.v2.runtime.reflect.Lister;

import java.io.*;
import java.util.*;

public class Main {

    void run() {
        while (true) {
            int N = readInt();
            int M = readInt();
            if (N == 0 && M == 0) break;
            boolean[] virus = new boolean[N];
            Arrays.fill(virus, false);
            virus[0] = true;
            ArrayList<Packet> p = new ArrayList<Packet>();
            for (int i = 0; i < M; i++) {
                int t = readInt();
                int s = readInt() - 1;
                int d = readInt() - 1;
                p.add(new Packet(t, s, d));
            }
            Collections.sort(p);
            for (int i = 0; i < M; i++) {
                if (virus[p.get(i).src]) {
                    virus[p.get(i).dst] = true;
                }
            }
            int ans = 0;
            for (int i = 0; i < N; i++) {
                if (virus[i]) ++ans;
            }
            sysout.println(ans);
        }
    }

    class Packet implements Comparable<Packet> {
        public int time, src, dst;

        public Packet(int time, int src, int dst) {
            this.time = time;
            this.src = src;
            this.dst = dst;
        }

        @Override
        public int compareTo(Packet o) {
            return time - o.time;
        }
    }

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

    // flush automatically iff you call `println` or `printf` or `format`.
    PrintWriter sysout = new PrintWriter(System.out, true);

    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer buffer = new StringTokenizer("");

    String read() {
        if (!buffer.hasMoreTokens()) {
            try {
                buffer = new StringTokenizer(in.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return buffer.nextToken();
    }

    int readInt() {
        return Integer.parseInt(read());
    }

    long readLong() {
        return Long.parseLong(read());
    }

    double readDouble() {
        return Double.parseDouble(read());
    }

    String readLine() {
        buffer = new StringTokenizer("");
        try {
            return in.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}

Compiler output:
Main.java:1: error: package com.sun.xml.internal.bind.v2.runtime.reflect does not exist
import com.sun.xml.internal.bind.v2.runtime.reflect.Lister;
                                                   ^
1 error
Language: Java

import java.util.Scanner;
public class AOJ_2155
{
	private class Data
	{
		long t;
		int s,d;
		Data(long t,int s,int d)
		{
			this.t = t;
			this.s = s;
			this.d = d;
		}
	}
	public void sort(Data[] datas)
	{
		for(int i = 0;i < datas.length - 1;i++)
		{
			for(int j = i + 1;j < datas.length;j++)
			{
				if(datas[i].t > datas[i].t)
				{
					Data tmp = datas[i];
					datas[i] = datas[j];
					datas[j] = tmp;
				}
			}
		}
	}
	public void solve()
	{
		Scanner cin = new Scanner(System.in);
		while(true)
		{
			int N = cin.nextInt();
			int M = cin.nextInt();
			if( N == 0 && M == 0)break;
			int[] infected = new int[N];
			infected[0]++;
			Data[] datas = new Data[M];
			for(int i = 0;i < M;i++)
			{
				datas[i] = new Data(cin.nextLong(),cin.nextInt() - 1,cin.nextInt() - 1);
			}
			
			sort(datas);
			for(int i = 0;i < M;i++)
			{
				if(infected[datas[i].s] > 0)
				{
					infected[datas[i].d]++;
				}
			}
			int ans = 0;
			for(int i = 0;i < N;i++)
			{
				if(infected[i] > 0)ans++;
			}
			
			System.out.println(ans);
		}
	}
	public static void main(String[] args)
	{
		new AOJ_2155().solve();
	}
}

Compiler output:
Main.java:2: error: class AOJ_2155 is public, should be declared in a file named AOJ_2155.java
public class AOJ_2155
       ^
1 error