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

#include<cstdio>
#define REP(i,a,n) for(int i  = a;i < n;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
int in(){int n;scanf("%d",&n); return n;}
int main(void){
 int atlas[10][10];
 rep(i,8){

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:2: error: expected '}' at end of input
   11 | }
      |  ^
a.cc:6:15: note: to match this '{'
    6 | int main(void){
      |               ^
Language: Java

import static color.ImageUtility.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.ArrayList;
import javax.imageio.ImageIO;

public class Main {
    
    static int horW[]=new int[20],verW[]=new int[20];
    public static void main(String[] args)  {
        try{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        
        ArrayList<Character>walk=new ArrayList<Character>();
        while((line=br.readLine())!=null){
            for(int i=0;i<4;i++) horW[i]=Integer.parseInt(line.charAt(i)+"");
            for(int i=0;i<4;i++){
                line=br.readLine();for(int j=0;j<4;j++)horW[4*(i+1)+j]=Integer.parseInt(line.charAt(j)+"");
                line=br.readLine();for(int j=0;j<5;j++)verW[5*i+j]=Integer.parseInt(line.charAt(j)+"");
            }
            break;
        }
        walk.add('R');
        walkon(walk,1,0);
        for(char ch : walk) System.out.print(ch);
            System.out.println("");
              
        }catch(Exception e){}
    }
    static boolean walkon(ArrayList<Character>walk,int x, int y){
        char preD=walk.get(walk.size()-1);char nextD='1';int nX=x,nY=y;
        int uW = (y==0)? 0:verW[(y-1)*5+x]; int dW = (y==4)? 0: verW[y*5+x];
        int rW = (x==4)? 0:horW[x+4*y]; int lW =(x==0)? 0: horW[x-1+4*y];
        switch(preD){
            case 'R':
                if(uW==1){nextD='U';nY--;}
                else if(rW==1){nextD='R';nX++;}else if(dW==1){nextD='D';nY++;}
                break;
            case 'U':
                if(lW==1){nextD='L';nX--;}else if(uW==1){nextD='U';nY--;}
                else if(rW==1){nextD='R';nX++;}
                break;
            case 'L':
                if(dW==1){nextD='D';nY++;}else if(lW==1){nextD='L';nX--;}
                else if(uW==1){nextD='U';nY--;}break;
            case 'D':
                if(rW==1){nextD='R';nX++;}else if(dW==1){nextD='D';nY++;}
                else if(lW==1){nextD='L';nX--;}break;
        }
        walk.add(nextD);
        if(nX==0&&nY==0)return true;
        else return walkon(walk,nX,nY);
    }
}

Compiler output:
Main.java:1: error: package color does not exist
import static color.ImageUtility.*;
                   ^
1 error
Language: Java

import java.io.*;
import java.awt.*;
import jav.util.*;

class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine;
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,inty){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
returm;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}

Compiler output:
Main.java:53: error: <identifier> expected
static void gotoDirection(String dir,int x,inty){
                                               ^
Main.java:114: error: illegal start of expression
static void gotoPath(int x,int y){
^
Main.java:127: error: not a statement
returm;
^
3 errors
Language: Java

import java.io.*;
import java.awt.*;
import jav.util.*;

class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine;
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,inty){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
return;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}

Compiler output:
Main.java:53: error: <identifier> expected
static void gotoDirection(String dir,int x,inty){
                                               ^
1 error
Language: Java

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

class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
return;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}

Compiler output:
Main.java:46: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
      ^
Main.java:60: error: incompatible types: String cannot be converted to boolean
if(dir="L"){
      ^
Main.java:122: error: cannot find symbol
d.offerLast(p);
^
  symbol:   variable d
  location: class Main
Main.java:123: error: cannot find symbol
while(que.peekFirst!=null){
         ^
  symbol:   variable peekFirst
  location: variable que of type Deque<Point>
4 errors
Language: Java

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

class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[40];
//n?????????????????????????¨????(?????????n=0?????¨??????"")
static int[][] times=new int[5][5];
//????????????x,y????????£??????????¨????(?????????0,0???0??¨??????)
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir=="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=0;
times[0][0]=count++;
dp[count]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
d.offerLast(p);
while(que.peekFirst!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)!=0){
return;
}
int t=times[px][py];
if(t!=0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
px=0;
py=0;
}
count++;
Point np=new Point(px,py);
que.offerLast(np);
}
}
}

Compiler output:
Main.java:122: error: cannot find symbol
d.offerLast(p);
^
  symbol:   variable d
  location: class Main
Main.java:123: error: cannot find symbol
while(que.peekFirst!=null){
         ^
  symbol:   variable peekFirst
  location: variable que of type Deque<Point>
2 errors
Language: Java

import java.io.*;
import java.awt.*;
import java.util.*;
 
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[25];
static int[][] times=new int[5][5];
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
for(int i=0;i<5;i++){
for(int j=0;j<5;i++){
times[i][j]~0;
}
}
gotoPath(0,1);
System.out.print("\n");
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir=="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=1;
times[0][0]=0;
dp[1]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
que.offerFirst(p);
while(que.peekFirst()!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px&py)==0){
return;
}
int t=times[px][py];
if(t>0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
return;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
return;
}
count++;
Point np=new Point();
np.x=px;
np.y=py;
que.offerFirst(np);
}
}
}

Compiler output:
Main.java:23: error: not a statement
times[i][j]~0;
        ^
Main.java:23: error: ';' expected
times[i][j]~0;
           ^
2 errors
Language: Java

import java.io.*;
import java.awt.*;
import java.util.*;
 
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[25];
static int[][] times=new int[5][5];
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
System.out.print("\n");
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir=="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=1;
times[0][0]=0;
dp[1]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
que.offerFirst(p);
while(que.peekFirst()!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px==0py==0){
return;
}
int t=times[px][py];
if(t>0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
return;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
return;
}
count++;
Point np=new Point();
np.x=px;
np.y=py;
que.offerFirst(np);
}
}
}

Compiler output:
Main.java:126: error: ')' expected
if((px==0py==0){
         ^
Main.java:126: error: not a statement
if((px==0py==0){
           ^
Main.java:126: error: ';' expected
if((px==0py==0){
              ^
3 errors
Language: Java

import java.io.*;
import java.awt.*;
import java.util.*;
 
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[25];
static int[][] times=new int[5][5];
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
System.out.print("\n");
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir=="L"){
y--;
}
else{
x++;
}
}
static String returntoStart(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=1;
times[0][0]=0;
dp[1]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
que.offerFirst(p);
while(que.peekFirst()!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if((px==0&&py==0){
return;
}
int t=times[px][py];
if(t>0){
for(int i=t;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
return;
}
times[px][py]=count;
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
for(int i=count;i>0;i--){
String str=dp[i];
System.out.print(returntoStart(str));
}
return;
}
count++;
Point np=new Point();
np.x=px;
np.y=py;
que.offerFirst(np);
}
}
}

Compiler output:
Main.java:126: error: ')' expected
if((px==0&&py==0){
                 ^
1 error
Language: Java

import java.io.*;
import java.awt.*;
import java.util.*;
 
class Main{
static char[][] map=new char[9][5];
static String[] dp=new String[25];
static int[][] times=new int[5][5];
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
gotoPath(0,1);
System.out.print("\n");
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static void gotoDirection(String dir,int x,int y){
if(dir=="R"){
y++;
}
if(dir=="U"){
x--;
}
if(dir=="L"){
y--;
}
else{
x++;
}
}
static String back(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y){
Point p=new Point(x,y);
int count=1;
times[0][0]=0;
dp[1]="R";
System.out.print("R");
Deque<Point> que=new ArrayDeque<Point>();
que.offerFirst(p);
while(que.peekFirst()!=null){
p=que.pollFirst();
int px=p.x;
int py=p.y;
if(px==0&&py==0){
return;
}
String dir=dp[count];
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
String dirb=back(dir);
if(cangoNext(dirl,px,py)){
gotoDirection(dirl,px,py);
System.out.print(dirl);
dp[count+1]=dirl;
}
else if(cangoNext(dir,px,py)){
gotoDirection(dir,px,py);
System.out.print(dir);
dp[count+1]=dir;
}
else if(cangoNext(dirr,px,py)){
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
else{
gotoDirection(dirr,px,py);
System.out.print(dirr);
dp[count+1]=dirr;
}
return;
}
count++;
Point np=new Point();
np.x=px;
np.y=py;
que.offerFirst(np);
}
}
}

Compiler output:
Main.java:162: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

import java.io.*;
import java.awt.*;
import java.util.*;
 
class Main{
static char[][] map=new char[9][5];
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
for(int i=0;i<9;i++){
line=br.readLine();
for(int j=0;j<4;j++){
map[i][j]=line.charAt(j);
}
if(i%2==1){
map[i][4]=line.charAt(4);
}
}
System.out.print("R");
gotoPath(0,1,"R");
System.out.print("\n");
}
static String turnLeft(String dir){
if(dir=="R"){
return "U";
}
if(dir=="U"){
return "L";
}
if(dir=="L"){
return "D";
}
else{
return "R";
}
}
static String turnRight(String dir){
if(dir=="R"){
return "D";
}
if(dir=="U"){
return "R";
}
if(dir=="L"){
return "U";
}
else{
return "L";
}
}
static String back(String dir){
if(dir=="R"){
return "L";
}
if(dir=="U"){
return "D";
}
if(dir=="L"){
return "R";
}
else{
return "U";
}
}
static boolean cangoNext(String dir,int x,int y){
if(dir=="R"){
if(y+1<=4&&map[2*x][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="U"){
if(x-1>=0&&map[2*x-1][y]=='1'){
return true;
}
else{
return false;
}
}
if(dir=="L"){
if(y-1>=0&&map[2*x][y-1]=='1'){
return true;
}
else{
return false;
}
}
else{
if(x+1<=4&&map[2*x+1][y]=='1'){
return true;
}
else{
return false;
}
}
}
static void gotoPath(int x,int y,String d){
if(x==0&&y==0){
return;
}
String di;
String dir=d;
String dirl=turnLeft(dir);
String dirr=turnRight(dir);
String dirb=back(d);
if(cangoNext(dirl,x,y)){
System.out.print(dirl);
di=dirl;
}
else if(cangoNext(dir,x,y)){
System.out.print(dir);
di=dir;
}
else if(cangoNext(dirr,x,y)){
System.out.print(dirr);
String di=dirr;
}
else{
System.out.print(dirb);
String di=dirb;
}
if(di=="R"){
y++;
}
if(di=="U"){
x--;
}
if(di=="L"){
y--;
}
if(di=="D");{
x++;
}
gotoPath(x,y,di);
}
}

Compiler output:
Main.java:118: error: variable di is already defined in method gotoPath(int,int,String)
String di=dirr;
       ^
Main.java:122: error: variable di is already defined in method gotoPath(int,int,String)
String di=dirb;
       ^
2 errors
Language: Java

import java.util.Scanner;
import java.util.Arrays;
public class Main {
    static int[][] grid;
    static int MAX_HEIGHT = 9;
    static int MAX_WIDTH = 9;
    public static void main (String[] args) {
	Scanner scan = new Scanner(System.in);
	grid = new int[MAX_HEIGHT][MAX_WIDTH];
	String line;
	int width, n, pos;
	for (int i = 0; i < 9; i++) {
	    line = scan.nextLine();
	    width = 0;
	    for (int j = 0; j < line.length(); j++) {
		n = Integer.parseInt(line.substring(j, j+1));
		if (n == 0) {
		    continue;
		}
		if (i % 2 == 0) {
		    pos = j * 2;
		    grid[i][pos] = 1;
		    grid[i][pos+1] = 1;
		    grid[i][pos+2] = 1;
		} else {
		    pos = j*2;
		    grid[i-1][pos] = 1;
		    grid[i][pos] = 1;
		    grid[i+1][pos] = 1;
		}
	    }
	}
	solve();
    }
    
    static void solve () {
	StringBuilder sb = new StringBuilder();
	int width = 0, height = 0, direction = 0;
	int[] dwidth = {1, 0, -1, 0};
	int[] dheight = {0, 1, 0, -1};
	String[] textdirection = {"R", "D", "L", "U"};
	
	while (true) {
	    for (int i = 3; i < 7; i++) {
		int nextwidth = width + dwidth[(i + direction) % 4];
		int nextheight = height + dheight[(i + direction) % 4];
		int nextnextwidth = nextwidth + dwidth[(i + direction) % 4];
		int nextnextheight = nextheight + dheight[(i + direction) % 4];
		if (!(0 <= nextwidth && nextwidth < MAX_WIDTH && 0 <= nextheight && nextheight < MAX_HEIGHT)) {
		    continue;
		}
		if (!(0 <= nextnextwidth && nextnextwidth < MAX_WIDTH && 0 <= nextnextheight && nextnextheight < MAX_HEIGHT)) {
		    continue;
		}
		if (grid[nextheight][nextwidth] == 0 || grid[nextnextheight][nextnextwidth] == 0) {
		    continue;
		}
		width = nextnextwidth;
		height = nextnextheight;
		direction = (i + direction) % 4;
		sb.append(textdirection[direction]);
		break;
	    }
	    if (width == 0 && height == 0) {
		break;
	    }
	}
	System.out.println(sb.toString());
    }

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

import java.util.*;

public class Main {

	int[][] mapA = new int[5][4];
	int[][] mapB = new int[4][5];
	int x, y, d;
	boolean flag;
	
	void U(){
		if(flag==true && y>0 && mapB[y-1][x]==1){
			d=0;
			y--;
			flag = false;
			System.out.print("U");
		}
	}
	
	void R(){
		if(flag==true && x<4 && mapA[y][x]==1){
			d=1;
			x++;
			flag = false;
			System.out.print("R");
		}
	}
	
	void D(){
		if(flag==true && y<4 && mapB[y][x]==1){
			d=2;
			y++;
			flag = false;
			System.out.print("D");
		}
	}
	
	void L(){
		if(flag==true && x>0 && mapA[y][x-1]==1){
			d=3;
			x--;
			flag = false;
			System.out.print("L");
		}
	}
	
	void solve(){
		Scanner sc = new Scanner(System.in);
		
		for(int i=0;i<9;i++){
			String s = sc.next();
			if(i%2==0){
				for(int j=0;j<4;j++) mapA[i/2][j] = s.codePointAt(j)-48;
			}else{
				for(int j=0;j<5;j++) mapB[i/2][j] = s.codePointAt(j)-48;
			}
		}
		x = 0;
		y = 0;
		d = 1;

		while(true){
			flag = true;
			if(d==0){
				L();
				U();
				R();
				D();
			}else if(d==1){
				U();
				R();
				D();
				L();
			}else if(d==2){
				R();
				D();
				L();
				U();
			}else if(d==3){
				D();
				L();
				U();
				R();
			}
			
			if(x==0 && y==0){
				System.out.println();
				break;
			}
		}
	}
	
	
	public static void main(String[] args) {
		new AOJ_0037().solve();
	}
}

Compiler output:
Main.java:94: error: cannot find symbol
		new AOJ_0037().solve();
		    ^
  symbol:   class AOJ_0037
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main {

	int[][] mapA = new int[5][4];
	int[][] mapB = new int[4][5];
	int x, y, d;
	boolean flag;
	
	void U(){
		if(flag==true && y>0 && mapB[y-1][x]==1){
			d=0;
			y--;
			flag = false;
			System.out.print("U");
		}
	}
	
	void R(){
		if(flag==true && x<4 && mapA[y][x]==1){
			d=1;
			x++;
			flag = false;
			System.out.print("R");
		}
	}
	
	void D(){
		if(flag==true && y<4 && mapB[y][x]==1){
			d=2;
			y++;
			flag = false;
			System.out.print("D");
		}
	}
	
	void L(){
		if(flag==true && x>0 && mapA[y][x-1]==1){
			d=3;
			x--;
			flag = false;
			System.out.print("L");
		}
	}
	
	void solve(){
		Scanner sc = new Scanner(System.in);
		
		for(int i=0;i<9;i++){
			String s = sc.next();
			if(i%2==0){
				for(int j=0;j<4;j++) mapA[i/2][j] = s.codePointAt(j)-48;
			}else{
				for(int j=0;j<5;j++) mapB[i/2][j] = s.codePointAt(j)-48;
			}
		}
		x = 0;
		y = 0;
		d = 1;

		while(true){
			flag = true;
			if(d==0){
				L();
				U();
				R();
				D();
			}else if(d==1){
				U();
				R();
				D();
				L();
			}else if(d==2){
				R();
				D();
				L();
				U();
			}else if(d==3){
				D();
				L();
				U();
				R();
			}
			
			if(x==0 && y==0){
				System.out.println();
				break;
			}
		}
	}
	
	
	public static void main(String[] args) {
		new Main.solve();
	}
}

Compiler output:
Main.java:94: error: cannot find symbol
		new Main.solve();
		        ^
  symbol:   class solve
  location: class Main
1 error
Language: Java

import java.util.Scanner;

//Path on a Grid
public class Main {

	void run(){
		int[][] move = {{-1,0},{0,1},{1,0},{0,-1}};
		char[] ch = {'U','R','D','L'};
		Scanner sc = new Scanner(System.in);
		boolean[][] e = new boolean[25][25];
		int h = 0, t = 0;
		for(int x=0;x<9;x++){
			char[] s = sc.next().toCharArray();
			for(int j=0;j<s.length;j++){
				if(s[j]=='0')continue;
				if(t==0)e[h*5+j][h*5+j+1] = e[h*5+j+1][h*5+j] = true;
				else e[h*5+j][(h+1)*5+j] = e[(h+1)*5+j][h*5+j] = true;
			}
			if(t==1)h++;
			t=(t+1)%2;
		}
		int i=0, j=0, d=1;
		StringBuilder sb = new StringBuilder();
		boolean con = true;
		while(con){
			for(int k=3;k<=6;k++){
				int nd = (d+k)%4;
				int ni = i+move[nd][0];
				int nj = j+move[nd][1];
				if(0<=ni&&ni<5&&0<=nj&&nj<5&&e[i*5+j][ni*5+nj]){
					sb.append(ch[nd]);
					i = ni; j = nj; d = nd;
					if(i==0&&j==0)con = false;
					break;
				}
			}
		}
		System.out.println(sb);
	}
	
	public static void main(String[] args) {
		new AOJ0037().run();
	}
}

Compiler output:
Main.java:42: error: cannot find symbol
		new AOJ0037().run();
		    ^
  symbol:   class AOJ0037
  location: class Main
1 error
Language: C

#include<stdio.h>
char f[6][6],i,j,a,y,x,p;
int main()
{
	for(;i<9;++i){
		gets(f[5]);
		for(j=0;j<4+i%2;++j){
			a=f[5][j]-48;
			f[i/2][j]|=a<<(1+i%2);
			f[i/2+i%2][j+!(i%2)]|=a<<3-i%2*3;
		}
	}
	do{
		while(!((f[y][x]>>(p=(p+1)%4))&1));
		putchar("URDL"[p]);
		x+=p?2-p:0;
		y+=p==3?0:p-1;
		p=(p+2)%4;
	}while(y||x||f[0][0]==6&&p==3);
	return!puts(""); 
}

Compiler output:
main.c: In function 'main':
main.c:6:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    6 |                 gets(f[5]);
      |                 ^~~~
      |                 fgets
Language: C++

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

int main(){
    char ma[11][11];
    memset(ma,'0',sizeof(ma));
    for(int i=1;i<10;i++){
        if(i%2==1)
            for(int j=2;j<9;j+=2)
                cin>>ma[i][j];
        else
            for(int j=1;j<10;j+=2)
                cin>>ma[i][j];
    }
    int x=1,y=1,dir=0;
    int mv[4][2]={{2,0},{0,2},{-2,0},{0,-2}};
    int ts[4][6]={{1,-1,1,0,0,-1},{1,1,0,1,1,0},{-1,1,-1,0,0,1},{-1,-1,0,-1,-1,0}};
    string str[4]={"R","D","L","U"};
    string path="";
    int ch=0;
    for(int k=0;k<40;k++){
        int wen=1;
        while(ma[y+ts[dir][3]][x+ts[dir][2]]=='1'){
            y+=mv[dir][1];
            x+=mv[dir][0];
            wen=0;
            path+=str[dir];
            wen++;
        }
        if(x==1&&y==1)
            break;
        if(ma[y+ts[dir][5]][x+ts[dir][4]]=='1')ch=1;
        do{
            if(ch==0)dir=(dir+1)%4;
            else dir=(dir+4-1)%4;
        }while((y+ts[dir][3]>10||y+ts[dir][3]<0||x+ts[dir][2]>10||x+ts[dir][2]<0)||ma[y+ts[dir][1]][x+ts[dir][0]]=='1');
        
    }
    cout<<path<<endl;
}
//RRRRDDDDLLLUUURRDDLURULLDDDRRRUUUULLLL
//RRRRDDDDLLLUUURRDDLURULLDDDRRRUUUULLLL

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

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

string str[100];
int len;
int fie[101][101];
int m;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
char s[4]={'R','D','L','U'};
int main(void){
	int n=0;
	while(cin >> str[n])n++;
	if(n>9){
		printf("0\n")
		return 0;
	}
	m=str[0].size();
	for(int i=0;i<n;i++){
		for(int j=0;j<str[i].size();j++){
			if(str[i][j]=='1'){
				if(i%2==0)fie[j*2+2][i+1]=1;
				if(i%2==1)fie[j*2+1][i+1]=1;
			}
		}
	}
	int x=2,y=0,dir=0;
	while(1){
		int nx=x+dx[(dir+1)%4],ny=y+dy[(dir+1)%4];
		if(nx>=0 && nx<=m*2+2 && ny>=0 && ny<=n+1){
			if(fie[nx][ny]==1)printf("%c",s[dir]);
		}
		nx=x+dx[dir],ny=y+dy[dir];
		if(nx>=0 && nx<=m*2+2 && ny>=0 && ny<=n+1){
			if(fie[nx][ny]==0){
				x+=dx[dir]*2;
				y+=dy[dir]*2;
				if(fie[x+dx[(dir+1)%4]][y+dy[(dir+1)%4]]==0){
					dir=(dir+1)%4;
				}
			}else{
				if(fie[x+dx[(dir+3)%4]][y+dy[(dir+3)%4]]==0){
					dir=(dir+3)%4;
					x+=dx[dir]*2;
					y+=dy[dir]*2;
					printf("%c",s[dir]);
				}else{
					dir=(dir+2)%4;
					x+=dx[dir]*2;
					y+=dy[dir]*2;
					printf("%c",s[(dir+1)%4]);
					printf("%c",s[dir]);
				}
			}
		}else dir=(dir+1)%4;
		//printf("%d %d %d %d %d\n",x,y,dir,dx[dir],dy[dir]);
		if(x==0 && y==0)break;
	}
	printf("\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:30: error: expected ';' before 'return'
   17 |                 printf("0\n")
      |                              ^
      |                              ;
   18 |                 return 0;
      |                 ~~~~~~
Language: C++

#include<stdio.h>///////AOJ0037
                            int
                            w[5
       ][5],i,j;char(b)[    128
       ],*           p;F    (//
       int           v){    for
       (i=    scanf("%s"    ,b)
       -1,    p=b    ;*p    ;++
       p){    w[p    -b+    1-v
       ][j    +v]|=((w[p    -b]
       [j]                  |=(
       p[0                  ]==
       49)<<3-v)&8>>v)>>2;}j+=v

     ;}
    main
  (){  for
 (;F     (0)
,j-       4;F
(1));for(p=b,
j=(       *b=
3)^       3;i        +=-66+"BAB\
C"[       *b]      ,j+=       "?\
@A"       "@"      [*b        ]-(
                   1<<        6),*
                   ++p        =(*
                   b)[        "U"
                   "L"        "D"
                   "R"        ],i
                    +j;)for((++*
  b)&=~4;!((1<<*
         b)&
         w[i
         ][j
]);      (*b
+=3      )&=
~4)     ;re\
turn   !puts
  (b+1);}



Compiler output:
a.cc:5:24: error: ISO C++ forbids declaration of 'F' with no type [-fpermissive]
    5 |        ],*           p;F    (//
      |                        ^
a.cc: In function 'int F(int)':
a.cc:15:7: warning: no return statement in function returning non-void [-Wreturn-type]
   15 |      ;}
      |       ^
a.cc: At global scope:
a.cc:16:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   16 |     main
      |     ^~~~
Language: C++

#include<stdio.h>
#define r(i,n) for(int i=0;i<n;++i)
int f[5][5];
main(e,f)
{
	r(i,9){
		char s[6];
		scanf("%s",s);
		if(i%2){
			r(j,5){
				int a=s[j]-'0';
				f[i/2][j]|=a<<2;
				f[i/2+1][j]|=a;
			}
		}else{
			r(j,4){
				int a=s[j]-'0';
				f[i/2][j]|=a<<1;
				f[i/2][j+1]|=a<<3;
			}
		}
	}
	printf("R");
	int y=0,x=1,p=1;
	do{
		p=(p+2)%4;
		int d=p;
		do
			d=(d+1)%4;
		while(!((f[y][x]>>d)&1));
		p=d;
		putchar("URDL"[d]);
		int dx[] = {0, 1, 0, -1};
		int dy[] = {-1, 0, 1, 0};
		x+=dx[d];
		y+=dy[d];
	}while(y!=0||x!=0||f[0][0]==6&&p==3);
	puts("");
}

Compiler output:
a.cc:4:5: error: expected constructor, destructor, or type conversion before '(' token
    4 | main(e,f)
      |     ^
Language: C++

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

int a[12][12];
int dx[4]  = {1,0,-1,0};
int dy[4]  = {0,1,0,-1};
char dc[4] = {'R','D','L','U'};

//©ªÌüÍS}XÌÇÌóÔð²×é
void cheakWall(int* wall , const int& px ,const int& py ,const int& d ){
	for(int i=0 ; i<4 ; ++i ){
		int mx = px + dx[(d+i)%4];
		int my = py + dy[(d+i)%4];
		wall[i] = a[my][mx];
	}
}

//iñ¾ü«ðL^
void record(string& s,int* wall){
	if( wall[1] ){
		s.push_back( dc[d] );
	}
}

//iÞ
void go(int& px, int& py, const int& d,int* wall, string& s){
	px += dx[d]*2;
	py += dy[d]*2;
	record(s,wall);
}

int main(){
	string s;

	//zñÌú»
	for(int y=0 ; y<12 ; ++y )
		for(int x=0 ; x<12 ; ++x )
			a[y][x] = 0;

	//üÍ
	for(int i=0 ; i<9 ; ++i ){
		cin >> s;
		int y = i+1;
		int x = (i+1)%2 + 1;
		for(int j=0 ; j<(int)s.size() ; ++j , x+=2 ){
			a[y][x] = s[j] - '0';
		}
	}

	int px = 2, py = 0, d = 0;
	bool flag = false;
	s.clear();

	while( 1 ){
		if( px == 0 && py == 0 ) break;

		int wall[4]; 
		//©ªÌüèÌóÔ
		cheakWall( wall , px , py , d );

		if( !wall[1] ){//EªÇ¶áÈ©Á½ç
			//ü«ðEü«Éñé
			d = (d+1)%4;
			//iÞ
			go( px , py , d , wall , s );
			flag = false;
		}else{
			if( !wall[0] ){//OªÇ¶áÈ©Á½ç
				//iÞ
				go( px , py , d , wall , s );
				flag = false;
			}else{
				if( !wall[3] ){//¶ªÇ¶áÈ©Á½ç
					if( flag == false ){
						//iñ¾ü«ðL^
						record(s,wall);
					}
					//ü«ð¶ü«Éñé
					d = (d+3)%4;
					//iÞ
					go( px , py , d , wall , s );
					flag = false;
				}else{//OEEE¶ªÇ¾Á½ç
					flag = true;
					//iñ¾ü«ðL^
					record(s,wall);
					//ü«ðEü«Éñé
					d = (d+3)%4;
					//iñ¾ü«ðL^
					s.push_back( dc[d] );
				}
			}
		}
	}
	cout << s << endl;
}

Compiler output:
a.cc: In function 'void record(std::string&, int*)':
a.cc:22:33: error: 'd' was not declared in this scope
   22 |                 s.push_back( dc[d] );
      |                                 ^
Language: C++

«ã¤èÍz

Compiler output:
a.cc:1:1: error: extended character  is not valid in an identifier
    1 | «ã¤èÍz
      | ^
a.cc:1:1: error: extended character « is not valid in an identifier
a.cc:1:1: error: extended character  is not valid in an identifier
a.cc:1:1: error: extended character  is not valid in an identifier
a.cc:1:1: error: extended character ¤ is not valid in an identifier
a.cc:1:1: error: extended character  is not valid in an identifier
a.cc:1:1: error: extended character  is not valid in an identifier
a.cc:1:1: error: extended character  is not valid in an identifier
a.cc:1:1: error: extended character  is not valid in an identifier
a.cc:1:1: error: extended character  is not valid in an identifier
a.cc:1:1: error: '\302\202\302\253\302\202\303\243\302\202\302\244\302\202\303\250\302\202\303\215\302\203z\302\203\302\202' does not name a type
    1 | «ã¤èÍz
      | ^~~~~~~~~~~~~~
Language: C++

#include<iostream>

main(){
cout << "«ã¤èÍz"<<endll;
}

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:4:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    4 | cout << "«ã¤èÍz"<<endll;
      | ^~~~
      | std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:4:27: error: 'endll' was not declared in this scope
    4 | cout << "«ã¤èÍz"<<endll;
      |                           ^~~~~
Language: C++

ツづ卍つーツつ「

Compiler output:
a.cc:1:1: error: extended character 「 is not valid in an identifier
    1 | ツづ卍つーツつ「
      | ^
a.cc:1:1: error: '\U000030c4\U00003065\U0000534d\U00003064\U000030fc\U000030c4\U00003064\U0000300c' does not name a type
    1 | ツづ卍つーツつ「
      | ^~~~~~~~~~~~~~~~
Language: C++

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

#define RIGHT 0
#define DOWN 1
#define LEFT 2
#define UP 3

int main(){
	bool cross[5][5][4];	// x,y,dir
	int px=0, py=0, dir = RIGHT;
	int d[4][2] = {{1,0}, {0,1}, {-1,0}, {0,-1}};
	string str;
	memset( cross, 0, sizeof(cross) );
	for( int i=0; i<4; i++ ){
		getline( cin, str );
		for( int j=0; j<4; j++ ){
			cross[j][i][RIGHT] = cross[j+1][i][LEFT] = (str[j]=='1');
		}
		getline( cin, str );
		for( int j=0; j<5; j++ ){
			cross[j][i][DOWN] = cross[j][i+1][UP] = (str[j]=='1');
		}
	}
	getline( cin, str );
	for( int j=0; j<4; j++ ){
		cross[j][4][RIGHT] = cross[j+1][4][LEFT] = (str[j]=='1');
	}
	do{
		for( int i=0; i<4; i++ ){
			if( cross[px][py][(dir+3+i)%4] ){
				dir = (dir+3+i)%4;
				px += d[dir][0];
				py += d[dir][1];
//				cout << (dir==RIGHT)?"R":((dir==DOWN)?"D":((dir==LEFT)?"L":"U"));
				if( dir == RIGHT ){
					cout << 'R';
				}else if( dir == DOWN ){
					cout << 'D';
				}else if( dir == LEFT ){
					cout << 'L';
				}else if( dir == UP ){
					cout << 'U';
				}
				break;
			}
		}
	}while( px!=0 || py!=0 );
	cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'memset' was not declared in this scope
   15 |         memset( cross, 0, sizeof(cross) );
      |         ^~~~~~
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 | #include<string>
Language: C++

      }
      else if(ex[vy][vx-1] == 1) {
        vx--;
        direction = 3;
        cout << "L";
      }
    }
  }
  cout << endl;
}

Compiler output:
a.cc:1:7: error: expected declaration before '}' token
    1 |       }
      |       ^
a.cc:2:7: error: expected unqualified-id before 'else'
    2 |       else if(ex[vy][vx-1] == 1) {
      |       ^~~~
a.cc:7:5: error: expected declaration before '}' token
    7 |     }
      |     ^
a.cc:8:3: error: expected declaration before '}' token
    8 |   }
      |   ^
a.cc:9:3: error: 'cout' does not name a type
    9 |   cout << endl;
      |   ^~~~
a.cc:10:1: error: expected declaration before '}' token
   10 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
 
using namespace std;
 
#define rep(i,n) for(int i=0;i<int(n);i++)
 
void input(bool grid[][9])
{
    rep(i,9){
        string s;
        cin>>s;
        if(i%2==0)
            rep(j,4)
                grid[i][j*2+1]=s[j]-'0';
        else
            rep(j,5)a
                grid[i][j*2]=s[j]-'0';
    }
}
 
enum dir{
    UP,RIGHT,DOWN,LEFT
};
const int di[]={-1,0,1,0};
const int dj[]={0,1,0,-1};
const char output[]="URDL";
 
bool in_range(int i,int j)
{
    return 0<=i && i<9 && 0<=j && j<9;
}
 
int main()
{
    bool grid[9][9]={{0}};
    input(grid);
     
    int i=0,j=0;
    dir prev=RIGHT;
    for(;;){
        dir next[4]={LEFT,UP,RIGHT,DOWN};
        rotate(next,next+prev,next+4);
         
        int k;
        for(k=0;k<3;k++){
            if(in_range(i+di[next[k]],j+dj[next[k]]) && grid[i+di[next[k]]][j+dj[next[k]]])
                break;
        }
         
        cout<<output[next[k]];
         
        i+=di[next[k]]*2;
        j+=dj[next[k]]*2;
        prev=next[k];
         
        if(i==0 && j==0)
            break;
    }
    cout<<endl;
     
    return 0;
}

Compiler output:
a.cc: In function 'void input(bool (*)[9])':
a.cc:17:21: error: 'a' was not declared in this scope
   17 |             rep(j,5)a
      |                     ^
Language: C++

#include <iostream>
#include <cstdio>

#define LEFT 0
#define UP   1
#define RIGHT 2
#define DOWN 3

#define MIN(X,Y) ((X<Y)?X:Y)
#define MAX(X,Y) ((X>Y)?X:Y)

bool map[5][5][5][5];
int direction=RIGHT;
int pos[2]={0,0};
char nul[5000];


void read(void)
{
	for(int y=0;y<4;y++)
	{
		for(int x=0;x<4;x++)
			map[x][y][x+1][y] = (getchar()-'0' == 1);
		gets(nul);
		for(int x=0;x<5;x++)
			map[x][y][x][y+1] = (getchar()-'0' == 1);
		gets(nul);
	}
	for(int x=0;x<4;x++)
		map[x][4][x+1][4] = (getchar()-'0' == 1);
	return;
}

bool isenable(int x, int y)
{
	return ((0<=x)&&(x<=4))&&((0<=y)&&(y<=4));
}

bool isconnect(int dir)
{
	int x=pos[0], y=pos[1];
	switch(dir) {
		case LEFT:   x--;
			     break;
		case UP:     y--;
			     break;
		case RIGHT:  x++;
			     break;
		case DOWN:   y++;
			     break;
	}
	return (isenable(x,y)&&(map[MIN(pos[0],x)][MIN(pos[1],y)][MAX(pos[0],x)][MAX(pos[1],y)]));
}
void step(int dir)
{
	switch(dir) {
		case LEFT:   pos[0]--; std::cout << "L" << std::flush; direction=LEFT;
			     break;
		case UP:     pos[1]--; std::cout << "U" << std::flush; direction=UP;
			     break;
		case RIGHT:  pos[0]++; std::cout << "R" << std::flush; direction=RIGHT;
			     break;
		case DOWN:   pos[1]++; std::cout << "D" << std::flush; direction=DOWN;
			     break;
	}
	return;
}

void move(void)
{
	do {
		if(isconnect((direction+LEFT-1+4)%4))
			step((direction+LEFT-1+4)%4);
		else if(isconnect((direction+UP-1+4)%4))
			step((direction+UP-1+4)%4);
		else if(isconnect((direction+RIGHT-1+4)%4))
			step((direction+RIGHT-1+4)%4);
		else
			//std::cerr << "error" << std::endl;

		//std::cerr << "(x,y):" << pos[0] << "," << pos[1] << std::endl;
	}while(!(pos[0]==0 && pos[1]==0));

	std::cout << std::endl;
	return;
}

int main(void)
{
	for(int i=0; i<5; i++)
		for(int j=0; j<5; j++)
			for(int k=0; j<5; j++)
				for(int l=0; j<5; j++)
					map[i][j][k][l] = false;

	read();
	move();
}

Compiler output:
a.cc: In function 'void read()':
a.cc:24:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   24 |                 gets(nul);
      |                 ^~~~
      |                 getw
a.cc: In function 'void move()':
a.cc:82:9: error: expected primary-expression before '}' token
   82 |         }while(!(pos[0]==0 && pos[1]==0));
      |         ^