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

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
  string S;
  cin>>S;
  for(int i=0;i<S.size();++i)
  {
    if(S[i]=="R"&&i%2==0) 
    {
      cout<<"NO"<<endl;
      break;
    }
    {
      if(S[i]=="L"&&i%2!=0) cout<<"NO"<<endl;
      break;
    }
  }
  if(i==S.size()) cout<<"YES"<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(S[i]=="R"&&i%2==0)
a.cc:17:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |       if(S[i]=="L"&&i%2!=0) cout<<"NO"<<endl;
a.cc:21:6: error: 'i' was not declared in this scope
   21 |   if(i==S.size()) cout<<"YES"<<endl;
      |      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
    string S;
    cin>>S;
    for(int i=0;i<S.size();i++){
        bool j;
        j=(i%2==0 && S[i]='R') || (i%2==1 && S[i]='L');
        if(j){
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: lvalue required as left operand of assignment
   10 |         j=(i%2==0 && S[i]='R') || (i%2==1 && S[i]='L');
a.cc:10:43: error: lvalue required as left operand of assignment
   10 |         j=(i%2==0 && S[i]='R') || (i%2==1 && S[i]='L');
Language: C


#include <stdio.h>
int main(void)
{
	char s[100];
	int i, amari, count = 0;
	for(i = 0; i <= 99; i++){
		s[i] = 'D';
	}
	scanf("%s", s);
	
	for(i = 0; i <= 99; i++){
		amari = i % 2;
		if(s[i] != 'U' && s[i] != 'D') &&
		  ((amari == 0 && s[i] != 'R') ||
		   (amari == 1 && s[i] != 'L')){
		   	count++;
		   }
	}
	
	if(count > 0){
		printf("No");
	}else{
		printf("Yes");
	}
	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:19: error: expected identifier before '(' token
   15 |                   ((amari == 0 && s[i] != 'R') ||
      |                   ^
Language: C++

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

int main(){
  char s[100];
  int i;
  
  cin>>s;
  size_t l=s.length();
  
  for(i=0,i<l,i+1)
    if(i%2==0)
      if(s[i]=="R")
        cout<<"No";
  		return 0:
  	if(i%2==1)
      if(s[i]=="L")
        cout<<"No";
  		return 0;
    
  cout<<"Yes";
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: request for member 'length' in 's', which is of non-class type 'char [100]'
   10 |   size_t l=s.length();
      |              ^~~~~~
a.cc:12:18: error: expected ';' before ')' token
   12 |   for(i=0,i<l,i+1)
      |                  ^
      |                  ;
a.cc:16:17: error: expected primary-expression before 'return'
   16 |                 return 0:
      |                 ^~~~~~
a.cc:15:20: error: expected ';' before 'return'
   15 |         cout<<"No";
      |                    ^
      |                    ;
   16 |                 return 0:
      |                 ~~~~~~
a.cc:16:17: error: expected primary-expression before 'return'
   16 |                 return 0:
      |                 ^~~~~~
a.cc:15:20: error: expected ')' before 'return'
   15 |         cout<<"No";
      |                    ^
      |                    )
   16 |                 return 0:
      |                 ~~~~~~
a.cc:12:6: note: to match this '('
   12 |   for(i=0,i<l,i+1)
      |      ^
a.cc:16:25: error: expected ';' before ':' token
   16 |                 return 0:
      |                         ^
      |                         ;
a.cc:16:25: error: expected primary-expression before ':' token
Language: C++

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

int main(){
  char s[100];
  int i;
  
  cin>>s;
  size_t l=s.length();
  
  for(i=0,i<l,i+1)
    if(i%2==0)
      if(s[i]=="R")
        cout<<"No";
  		return 0:
  	if(i%2==1)
      if(s[i]=="L")
        cout<<"No";
  		return 0;
    else
      cout<<"Yes";
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: request for member 'length' in 's', which is of non-class type 'char [100]'
   10 |   size_t l=s.length();
      |              ^~~~~~
a.cc:12:18: error: expected ';' before ')' token
   12 |   for(i=0,i<l,i+1)
      |                  ^
      |                  ;
a.cc:16:17: error: expected primary-expression before 'return'
   16 |                 return 0:
      |                 ^~~~~~
a.cc:15:20: error: expected ';' before 'return'
   15 |         cout<<"No";
      |                    ^
      |                    ;
   16 |                 return 0:
      |                 ~~~~~~
a.cc:16:17: error: expected primary-expression before 'return'
   16 |                 return 0:
      |                 ^~~~~~
a.cc:15:20: error: expected ')' before 'return'
   15 |         cout<<"No";
      |                    ^
      |                    )
   16 |                 return 0:
      |                 ~~~~~~
a.cc:12:6: note: to match this '('
   12 |   for(i=0,i<l,i+1)
      |      ^
a.cc:16:25: error: expected ';' before ':' token
   16 |                 return 0:
      |                         ^
      |                         ;
a.cc:16:25: error: expected primary-expression before ':' token
a.cc:21:5: error: 'else' without a previous 'if'
   21 |     else
      |     ^~~~
Language: C++

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

int main(){
  char s[100];
  int i;
  
  cin>>s;
  size_t l=s.length();
  
  for(i=0,i<s,i+1)
    if(i%2==0)
      if(s[i]=="R")
        cout<<"No";
  		return 0:
  	if(i%2==1)
      if(s[i]=="L")
        cout<<"No";
  		return 0;
    else
      cout<<"Yes";
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: request for member 'length' in 's', which is of non-class type 'char [100]'
   10 |   size_t l=s.length();
      |              ^~~~~~
a.cc:12:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   for(i=0,i<s,i+1)
      |           ~^~
a.cc:12:18: error: expected ';' before ')' token
   12 |   for(i=0,i<s,i+1)
      |                  ^
      |                  ;
a.cc:16:17: error: expected primary-expression before 'return'
   16 |                 return 0:
      |                 ^~~~~~
a.cc:15:20: error: expected ';' before 'return'
   15 |         cout<<"No";
      |                    ^
      |                    ;
   16 |                 return 0:
      |                 ~~~~~~
a.cc:16:17: error: expected primary-expression before 'return'
   16 |                 return 0:
      |                 ^~~~~~
a.cc:15:20: error: expected ')' before 'return'
   15 |         cout<<"No";
      |                    ^
      |                    )
   16 |                 return 0:
      |                 ~~~~~~
a.cc:12:6: note: to match this '('
   12 |   for(i=0,i<s,i+1)
      |      ^
a.cc:16:25: error: expected ';' before ':' token
   16 |                 return 0:
      |                         ^
      |                         ;
a.cc:16:25: error: expected primary-expression before ':' token
a.cc:21:5: error: 'else' without a previous 'if'
   21 |     else
      |     ^~~~
Language: C++

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

int main(){
  string s;
  
  cin>>s;
  
  int l=s.find("L");
  int r=s.find("R");
  int u=s.find("U");
  int d=s.find("D");
  if (l%2=0)
    cout<<"No";
  else if(r%2=1)
    cout<<"No";
  else 
    cout<<"Yes";
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: lvalue required as left operand of assignment
   14 |   if (l%2=0)
      |       ~^~
a.cc:16:12: error: lvalue required as left operand of assignment
   16 |   else if(r%2=1)
      |           ~^~
Language: C++

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

int main(){
  string s;
  
  cin>>s;
  
  int l=s.find("L");
  int r=s.find("R");
  int u=s.find("U");
  int d=s.find("D");
  if (l%2=1)
    cout<<"No";
  else if(r%2=0)
    cout<<"No";
  else 
    cout<<"Yes";
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: lvalue required as left operand of assignment
   14 |   if (l%2=1)
      |       ~^~
a.cc:16:12: error: lvalue required as left operand of assignment
   16 |   else if(r%2=0)
      |           ~^~
Language: C++

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

int main(){
  string s;
  
  int l=s.find("L");
  int r=s.find("R");
  int u=s.find("U");
  int d=s.find("D");
  if (l%2=1)
    cout<<"No";
  else if(r%2=0)
    cout<<"No";
  else 
    cout<<"Yes";
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: lvalue required as left operand of assignment
   12 |   if (l%2=1)
      |       ~^~
a.cc:14:12: error: lvalue required as left operand of assignment
   14 |   else if(r%2=0)
      |           ~^~
Language: C++

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

int main(){
  string s;
  
  int l=s.find("L");
  int r=s.find("R")
  int u=s.find("U");
  int d=s.find("D");
  if (l%2=1)
    cout<<"No";
  else if(r%2=0)
    cout<<"No";
  else 
    cout<<"Yes";
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'int'
   10 |   int u=s.find("U");
      |   ^~~
a.cc:12:8: error: lvalue required as left operand of assignment
   12 |   if (l%2=1)
      |       ~^~
a.cc:14:12: error: lvalue required as left operand of assignment
   14 |   else if(r%2=0)
      |           ~^~
Language: C++

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

int main()
{
        string s;

        cin >> s;

        for (int i = 0; i < s.length; i++) {
                if (i % 2 == 0 && s[i] == 'R') {
                        cout << "No" << endl;
                        return 0;
                }
                else if (i % 2 != 0 && s[i] == 'L') {
                        cout << "No" << endl;
                        return 0;
                }
        }

        cout << "Yes" << endl;

        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:31: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |         for (int i = 0; i < s.length; i++) {
      |                             ~~^~~~~~
      |                                     ()
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
    string s;
    cin >> s;
    for(int i = 0;i<n;i++){
        if(s[i]=='U'&&s[i]=='D'){
            continue;
        }
        else if(s[i]=='L'){
            if(i%2==0){
                cout << "No" << endl;
                return 0;
            }
        }
        else{
            if(i%2==1){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: 'n' was not declared in this scope
    7 |     for(int i = 0;i<n;i++){
      |                     ^
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string hoge;
    cin >> hoge;
    for (int i = 0; i < hoge.size(); i++) {
        if (i % 2 == 0 
        && (string[i] != "L" && string[i] != "U" && string[i] != "D")) {
            cout << "No" << endl;
            return;
        } else if (i % 2 == 1
        && string[i] != "R" && string[i] != "U" && string[i] != "D")) {
            cout << "No" << endl;
            return;
        }
    }
    cout << "Yes" << endl;
    return;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected primary-expression before '[' token
    9 |         && (string[i] != "L" && string[i] != "U" && string[i] != "D")) {
      |                   ^
a.cc:9:39: error: expected primary-expression before '[' token
    9 |         && (string[i] != "L" && string[i] != "U" && string[i] != "D")) {
      |                                       ^
a.cc:9:59: error: expected primary-expression before '[' token
    9 |         && (string[i] != "L" && string[i] != "U" && string[i] != "D")) {
      |                                                           ^
a.cc:11:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |             return;
      |             ^~~~~~
a.cc:13:18: error: expected primary-expression before '[' token
   13 |         && string[i] != "R" && string[i] != "U" && string[i] != "D")) {
      |                  ^
a.cc:13:38: error: expected primary-expression before '[' token
   13 |         && string[i] != "R" && string[i] != "U" && string[i] != "D")) {
      |                                      ^
a.cc:13:58: error: expected primary-expression before '[' token
   13 |         && string[i] != "R" && string[i] != "U" && string[i] != "D")) {
      |                                                          ^
a.cc:13:69: error: expected primary-expression before ')' token
   13 |         && string[i] != "R" && string[i] != "U" && string[i] != "D")) {
      |                                                                     ^
a.cc:19:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   19 |     return;
      |     ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main()
{
 string s;
  cin >> s;
  bool contradiction = false;
  for(int i = 0; i < s.length(); i+=2)
  {
    if(s[i] == 'L')
    {
      contradiction = true;
      break;
    }
  }
  
  for(int i = 1; i < s.length(); i+=2)
  {
    if(s[i]) == 'R')
    {
     contradiction = true;
      break;
    }
  }
  
  if(contradiction)
  {
   cout <<"no"<<endl; 
  }
  else
  {
    cout <<"yes"<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: expected primary-expression before '==' token
   20 |     if(s[i]) == 'R')
      |              ^~
Language: Java

import java.util.*;
public class Main {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
      String ans ="";	
      ans = getAns(s);
      System.out.println(ans);
	}
  
  public static String getAns(String s){
    String a = "";  
    for(int i=0;i<s.length();i++){
      String t = s.substriing(i,i+1) ; 
      //奇数番目の文字。iは奇数
        if(i%2==1){
          if(t.equals("L")){
            a = "No";
            return a;
          }else{
          	continue;
          }
        }else{
          if(t.equals("R")){
          	a ="No";
            return a;
          }else{
          	continue;
          }
        }
        
      }
    a ="Yes";
      return a;
  }
      
}


Compiler output:
Main.java:16: error: cannot find symbol
      String t = s.substriing(i,i+1) ; 
                  ^
  symbol:   method substriing(int,int)
  location: variable s of type String
1 error
Language: Java

import java.util.*;
public class Main {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
      String ans ="";	
      ans = getAns(s);
      System.out.println(ans);
	}
  
  public static String getAns(String s){
    String a = "";  
    for(int i=0;i<s.length();i++){
      char t = s[i] ; 
      //奇数番目の文字。iは奇数
        if(i%2==1){
          if(t.equals("L")){
            a = "No";
            return a;
          }else{
          	continue;
          }
        }else{
          if(t.equals("R")){
          	a ="No";
            return a;
          }else{
          	continue;
          }
        }
        
      }
    a ="Yes";
      return a;
  }
      
}


Compiler output:
Main.java:16: error: array required, but String found
      char t = s[i] ; 
                ^
Main.java:19: error: char cannot be dereferenced
          if(t.equals("L")){
              ^
Main.java:26: error: char cannot be dereferenced
          if(t.equals("R")){
              ^
3 errors
Language: Java

import java.util.*;
public class Main {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
      String ans ="";	
      ans = getAns(s);
      System.out.println(ans);
	}
  
  public static String getAns(String s){
    String a = "";  
    for(int i=0;i<s.length();i++){
      char t = s[i]  
      //奇数番目の文字。iは奇数
        if(i%2==1){
          if(t.equals("L")){
            a = "No";
            return a;
          }else{
          	continue;
          }
        }else{
          if(t.equals("R")){
          	a ="No";
            return a;
          }else{
          	continue;
          }
        }
        
      }
    a ="Yes";
      return a;
  }
      
}


Compiler output:
Main.java:16: error: ';' expected
      char t = s[i]  
                   ^
1 error
Language: Java

import java.util.*;
public class Main {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
      String ans ="";	
      ans = getAns(s);
      System.out.println(ans);
	}
  
  public static String getAns(String s){
    String a = "";  
    for(int i=0;i<s.length();i++){
        //奇数番目の文字。iは奇数
        if(i%2==1){
          if(s.equals("L")){
            a = "No";
            return a;
          }else{
          	continue;
          }
        }else{
          if(s.equals("R")){
          	a ="No";
            return a;
          }else{
          	continue;
          }
        }
        a ="Yes";
      return a;
      }
  }
      
}


Compiler output:
Main.java:32: error: unreachable statement
        a ="Yes";
        ^
Main.java:35: error: missing return statement
  }
  ^
2 errors
Language: Java

import java.util.*;
public class Main {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
      String ans ="";	
      ans = getAns(s);
      System.out.println(ans);
	}
  
  public String getAns(String s){
    String a = "";  
    for(int i=0;i<s.length();i++){
        //奇数番目の文字。iは奇数
        if(i%2==1){
          if(s.equals("L")){
            a = "No";
            return a;
          }else{
          	continue;
          }
        }else{
          if(s.equals("R")){
          	a ="No";
            return a;
          }else{
          	continue;
          }
        }
        a ="Yes";
      return a;
      }
  }
      
}


Compiler output:
Main.java:9: error: non-static method getAns(String) cannot be referenced from a static context
      ans = getAns(s);
            ^
1 error
Language: Java

import java.util.*;
public class Main {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
      String ans ="";	
      check(s);
      System.out.println(ans);

      
      
      /*
      for(int i=0;i<s.length();i++){
        //奇数番目の文字。iは奇数
        if(i%2==1){
          if(s.equals("R") OR s.equals("U") OR s.equals("D")){
            
          }
        }
        System.out.println("No");
      }
      */
	}
  public void check(String s){
         for(int i=0;i<s.length();i++){
        //奇数番目の文字。iは奇数
        if(i%2==1){
          if(s.equals("L")){
            ans="No";
          }else{
          	continue;
          }
        }else{
          if(s.equals("R")){
          	ans="No";
          }else{
          	continue;
          }
        }
        ans="Yes";
      }
      
}


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

import java.util.*;
public class Main {

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
      String ans ="";	
      check(s);
      System.out.println(ans);

      public void check(String s){
         for(int i=0;i<s.length();i++){
        //奇数番目の文字。iは奇数
        if(i%2==1){
          if(s.equals("L")){
            ans="No";
          }else{
          	continue;
          }
        }else{
          if(s.equals("R")){
          	ans="No";
          }else{
          	continue;
          }
        }
        ans="Yes";
      }
      
      
      /*
      for(int i=0;i<s.length();i++){
        //奇数番目の文字。iは奇数
        if(i%2==1){
          if(s.equals("R") OR s.equals("U") OR s.equals("D")){
            
          }
        }
        System.out.println("No");
      }
      */
	}
}


Compiler output:
Main.java:12: error: illegal start of expression
      public void check(String s){
      ^
1 error
Language: Java

#include <bits/stdc++.h>
using namespace std;

int main() {
    bool a=true;
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++){
        if(i%2!=0){
            if(s.at(i)=='L' ||s.at(i)=='U'||s.at(i)=='D'){
            }else{
                a=false;
                break;
            }
        }else{
            if(s.at(i)=='R' ||s.at(i)=='U' || s.at(i)=='D'){
            }else{
                a=false;
                break;
            }
        }
    }
    if(a==true){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:7: error: not a statement
    cin>>s;
       ^
Main.java:24: error: not a statement
        cout<<"Yes"<<endl;
                   ^
Main.java:26: error: not a statement
        cout<<"No"<<endl;
                  ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
6 errors
Language: Java

import java.util.Scanner;

public class B {

	public static void main(String[] args) {

		String a;
		int count = 1;
		String flag = "No";
		Scanner sc = new Scanner(System.in);
		a = sc.next();
		String[] as = a.split("");
		for (String i : as) {
			if (count % 2 == 0) {
				if (i.equals("L") || i.equals("U") || i.equals("D")) {
					flag = "Yes";
				} else {
					flag = "No";
					return;
				}
			}
			if (count % 2 != 0) {
				if (i.equals("R") || i.equals("U") || i.equals("D")) {
					flag = "Yes";
				} else {
					flag = "No";
					return;
				}
			}
			count++;
		}

		sc.close();

		System.out.println(flag);

	}

}

Compiler output:
Main.java:3: error: class B is public, should be declared in a file named B.java
public class B {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
	string s;
	cin >> s;
	for(int i = 0 ; i < s.length() ;i++){
		if(i%2){
			if(s[i] == 'L'){ cout << "No" ; return 0;}  
		}
		else if(s[i] == 'R' || s[i] == 'D'){ cout << "No" ; return 0;}
	
	}
	cout << "Yes';
	return 0;
}

Compiler output:
a.cc:14:17: warning: missing terminating " character
   14 |         cout << "Yes';
      |                 ^
a.cc:14:17: error: missing terminating " character
   14 |         cout << "Yes';
      |                 ^~~~~~
a.cc: In function 'int main()':
a.cc:15:9: error: expected primary-expression before 'return'
   15 |         return 0;
      |         ^~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
int main()
{
    char str[101];
    gets(str);
    int len=strlen(str);
    for(int i=0;i<len;i+=2)
    {
        if(str[i]=='L')
        {
            cout<<"No"<<endl;
            return 0;
        }
    }
    for(int i=1;i<len;i+=2)
    {
        if(str[i]=='R')
        {
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |     gets(str);
      |     ^~~~
      |     getw
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    char str[101];
    gets(str);
    int len=strlen(str);
    for(int i=0;i<len;i+=2)
    {
        if(str[i]=='L')
        {
            cout<<"No"<<endl;
            return 0;
        }
    }
    for(int i=1;i<len;i+=2)
    {
        if(str[i]=='R')
        {
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |     gets(str);
      |     ^~~~
      |     getw
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    char s[105];
    int k=1;
    gets(s);
    for(int i=0;s[i]!='\0';i++)
    {
        if((i+1)%2==1&&s[i]=='L')
        {
            k=0;
            break;
        }
        if((i+1)%2==0&&s[i]=='R')
        {
            k=0;
            break;
        }
    }
    if(k==0)
        cout<<"No"<<endl;
    else
        cout<<"Yes"<<endl;
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |     gets(s);
      |     ^~~~
      |     getw
Language: C++

#include<iostream>
  
using namespace std;

bool check_even(string line){
for(size_t i = 0; i < line.size();i+=2){
if(line[i] != 'R' and  line[i]!='U' and  line[i] != 'D')return false;
}
return true;
}

bool check_odd(string line){
for(size_t i = 1; i < line.size();i+=2){
if(line[i] != 'L' and  line[i]!='U' and  line[i] != 'D')return false;
}
return true;
}


int main(){

string line;

cin>>line;

if(check_odd(line) and check_even(line))cout<<"Yes";
else cout<<"No";

}
~           

Compiler output:
a.cc:30:2: error: expected class-name at end of input
   30 | ~
      |  ^
Language: C++

#include<iostream>
  
using namespace std;

bool check_even(string line){
for(size_t i = 0; i < line.size();i+=2){
if(line[i] != 'R' and  line[i]!='U' and  line[i] != 'D')return false;
}
return true;
}

bool check_odd(string line){
for(size_t i = 1; i < line.size();i+=2){
if(line[i] != 'L' and  line[i]!='U' and  line[i] != 'D')return false;
}
return true;
}


int main(){

string line;

cin>>line;

if(check_odd(line))cout<<"Yes";
else if(check_even(line))cout<<"Yes";
else cout<<"No";

}
~                                                                                                                                                                                                           
~                                                                                                                                                                                                           
~                                                                                                                                                                                                           
~                                                                                                                                                                                                           
~                                                                                                                                                                                                           
~                                                                                                                                                                                                           
~          

Compiler output:
a.cc:32:1: error: expected class-name before '~' token
   32 | ~
      | ^
Language: C++

#include<iostream>
  
using namespace std;

bool check_even(string line){
for(size_t i = 0; i < line.size();i+=2){
if(line[i] != 'R' and  line[i]!='U' and  line[i] != 'D')return false;
}
return true;
}

bool check_odd(string line){
for(size_t i = 0; i < line.size();i+=2){
if(line[i] != 'L' and  line[i]!='U' and  line[i] != 'D')return false;
}
return true;
}


int main(){

string line;

cin>>line;

if(check_odd(line))cout<<"Yes";
else if(check_even(line))cout<<"Yes";
else cout<<"No";

}
~                              

Compiler output:
a.cc:31:2: error: expected class-name at end of input
   31 | ~
      |  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
	string S;
	cin >> S;
	for (int i = 0; i < S.size(); i++) {
		if (i % 2 == 0 && (S[i] == "R" || S[i] == "U" || S[i] == "D")) {
			continue;
		}
		if (i % 2 == 1 && (S[i] == "L" || S[i] == "U" || S[i] == "D")) {
			continue;
		}
		else {
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:41: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |                 if (i % 2 == 0 && (S[i] == "R" || S[i] == "U" || S[i] == "D")) {
a.cc:8:56: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |                 if (i % 2 == 0 && (S[i] == "R" || S[i] == "U" || S[i] == "D")) {
a.cc:8:71: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |                 if (i % 2 == 0 && (S[i] == "R" || S[i] == "U" || S[i] == "D")) {
a.cc:11:41: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |                 if (i % 2 == 1 && (S[i] == "L" || S[i] == "U" || S[i] == "D")) {
a.cc:11:56: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |                 if (i % 2 == 1 && (S[i] == "L" || S[i] == "U" || S[i] == "D")) {
a.cc:11:71: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |                 if (i % 2 == 1 && (S[i] == "L" || S[i] == "U" || S[i] == "D")) {
Language: C

#include <string.h>
#include <stdio.h>

int main(){
	bool fumiyasui = true;
	char S[100];
	scanf("%s",S);
	int N = strlen(S);
	for(int i=0;i<N;i+=2){
		if (S[i]=='R' || S[i]=='U' || S[i]=='D'){
			continue;
		}else {
			fumiyasui = false;
			break;
		}
	}
	if (fumiyasui != true){
		for(int i=1;i<N;i+=2){
			if (S[i]=='L' || S[i]=='U' || S[i]=='D'){
				continue;
				}else {
					fumiyasui = false;
					break;
					}
		}
	}
	if (fumiyasui = true){
		printf("Yes\n");
	}else {
		printf("No\n");
	}
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: unknown type name 'bool'
    5 |         bool fumiyasui = true;
      |         ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:5:26: error: 'true' undeclared (first use in this function)
    5 |         bool fumiyasui = true;
      |                          ^~~~
main.c:5:26: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:5:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:37: error: 'false' undeclared (first use in this function)
   13 |                         fumiyasui = false;
      |                                     ^~~~~
main.c:13:37: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++

#include<iostream>
#include<ctype.h>
using namespace std;
int main()
{ int f=1;
string s;
  getline(cin,s);
 int n;
  n=s.size();
 
for (int i=0;i<n;i+=1)
{
   if ((s[i]!='R'||s[i]!='D'||s[i]!='U')&& i%2==0)
   {
     f=0;
     break;
   }
  if ((s[i]!='L'||s[i]!='U'||s[i]!='D')&& i%2!=0))
   {
     f=0;
     break;
   }


}
if (f==1)
  cout<<"Yes";
 else 
   cout<<"No";
  

return 0;
}










Compiler output:
a.cc: In function 'int main()':
a.cc:18:50: error: expected primary-expression before ')' token
   18 |   if ((s[i]!='L'||s[i]!='U'||s[i]!='D')&& i%2!=0))
      |                                                  ^
Language: C++

#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{ string s;
bool f,c;
ll n;
std::list<char> l({'R';'D';'U'});
std::list<char> m({'L';'U';'D'});
f=true;
c=true;
cin >>s;
n=s.size();
for (int i=1; i<n+1;i++)
   {if(i %2=0) and not (s[i] in m)
        c=false;
    if(i %2=1) and not (s[i] in l)
        f=false;}
if(c and f)
    cout<<"Yes";
else cout <<"No"




}
return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: expected '}' before ';' token
    8 | std::list<char> l({'R';'D';'U'});
      |                   ~   ^
a.cc:8:23: error: expected ')' before ';' token
    8 | std::list<char> l({'R';'D';'U'});
      |                  ~    ^
      |                       )
a.cc:8:31: error: expected ';' before '}' token
    8 | std::list<char> l({'R';'D';'U'});
      |                               ^
      |                               ;
a.cc: At global scope:
a.cc:8:32: error: expected unqualified-id before ')' token
    8 | std::list<char> l({'R';'D';'U'});
      |                                ^
a.cc:9:23: error: expected '}' before ';' token
    9 | std::list<char> m({'L';'U';'D'});
      |                   ~   ^
a.cc:9:23: error: expected ')' before ';' token
    9 | std::list<char> m({'L';'U';'D'});
      |                  ~    ^
      |                       )
a.cc:9:24: error: expected unqualified-id before 'U'
    9 | std::list<char> m({'L';'U';'D'});
      |                        ^~~
a.cc:9:28: error: expected unqualified-id before 'D'
    9 | std::list<char> m({'L';'U';'D'});
      |                            ^~~
a.cc:9:31: error: expected declaration before '}' token
    9 | std::list<char> m({'L';'U';'D'});
      |                               ^
a.cc:9:32: error: expected unqualified-id before ')' token
    9 | std::list<char> m({'L';'U';'D'});
      |                                ^
a.cc:10:1: error: 'f' does not name a type
   10 | f=true;
      | ^
a.cc:11:1: error: 'c' does not name a type
   11 | c=true;
      | ^
a.cc:12:1: error: 'cin' does not name a type
   12 | cin >>s;
      | ^~~
a.cc:13:1: error: 'n' does not name a type
   13 | n=s.size();
      | ^
a.cc:14:1: error: expected unqualified-id before 'for'
   14 | for (int i=1; i<n+1;i++)
      | ^~~
a.cc:14:15: error: 'i' does not name a type
   14 | for (int i=1; i<n+1;i++)
      |               ^
a.cc:14:21: error: 'i' does not name a type
   14 | for (int i=1; i<n+1;i++)
      |                     ^
a.cc:19:1: error: expected unqualified-id before 'if'
   19 | if(c and f)
      | ^~
a.cc:21:1: error: expected unqualified-id before 'else'
   21 | else cout <<"No"
      | ^~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
a.cc:27:1: error: expected unqualified-id before 'return'
   27 | return 0;
      | ^~~~~~
Language: C++

#include<stdio.h>

int main(void0;
  char str[101],tx;
  scanf("%s",str);
  
  i=0;
  while(str[i] == '\0'){
    tx = str[i++];
    if((i+1)%2==0 && !(tx=='L'||tx=='U'||tx=='D')){
      flag = 1;
      break;
   }
    else if((i+1)i%2==1 && !(tx=='R'||tx=='U'||tx=='D')){
      flag = 1;
      break;
    }
  }
  
  if(flag == 1)
    printf("No");
  else
    printf("Yes");
}

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main(void0;
      |     ^~~~
a.cc:3:10: error: 'void0' was not declared in this scope; did you mean 'void'?
    3 | int main(void0;
      |          ^~~~~
      |          void
a.cc:5:8: error: expected constructor, destructor, or type conversion before '(' token
    5 |   scanf("%s",str);
      |        ^
a.cc:7:3: error: 'i' does not name a type
    7 |   i=0;
      |   ^
a.cc:8:3: error: expected unqualified-id before 'while'
    8 |   while(str[i] == '\0'){
      |   ^~~~~
a.cc:20:3: error: expected unqualified-id before 'if'
   20 |   if(flag == 1)
      |   ^~
a.cc:22:3: error: expected unqualified-id before 'else'
   22 |   else
      |   ^~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include<stdio.h>

int main(void){
  int i,flag=0;
  char str[101],tx;
  scanf("%s",str);
  
  i=0;
  while(str[i] == '\0'){
    tx = str[i];
    if(i%2==0 && !(tx=='L'||tx=='U'||tx=='D'))
      flag = 1;
    else if(i%2==1 && !(tx=='R'||tx=='U'||tx=='D'))
      flag = 1;
    i++
  }
  
  if(flag == 1)
    printf("No");
  else
    printf("Yes");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: expected ';' before '}' token
   15 |     i++
      |        ^
      |        ;
   16 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main()
{
   long long int i,j,k,l,m,n,p;
  string s;
  cin>>s;
  n=s.size();
  p=0;
  for(i=0;i<n;i++)
  {
    if(s[i]=='L' && i%2==0)
    {
      p=1;
    } 
    if(s[i]=='R' && i%2!=0)
    {
      p=1;
    }
  }
  if(p==0)
  {
    cout<<"YES\n"
  }
  if(p==1)
  {
    cout<<"NO\n";
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:18: error: expected ';' before '}' token
   24 |     cout<<"YES\n"
      |                  ^
      |                  ;
   25 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  string S;
  cin >> S;
  chr S_even[], S_odd[];
  
  for(int i=0; i<(S.size()+1)/2; i++){
    S_even[i] = S.at(i*2);
    S_odd[i] = S.at(i*2+1);
  }
  
  bool a = true;
  for(int i=0; i<(S.size()+1)/2; i++){
    if(S_even[i]=='R' || S_odd[i]=='L')
      a = false;
  }
  
  if(a==true)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'chr' was not declared in this scope; did you mean 'char'?
    7 |   chr S_even[], S_odd[];
      |   ^~~
      |   char
a.cc:10:5: error: 'S_even' was not declared in this scope
   10 |     S_even[i] = S.at(i*2);
      |     ^~~~~~
a.cc:11:5: error: 'S_odd' was not declared in this scope
   11 |     S_odd[i] = S.at(i*2+1);
      |     ^~~~~
a.cc:16:8: error: 'S_even' was not declared in this scope
   16 |     if(S_even[i]=='R' || S_odd[i]=='L')
      |        ^~~~~~
a.cc:16:26: error: 'S_odd' was not declared in this scope
   16 |     if(S_even[i]=='R' || S_odd[i]=='L')
      |                          ^~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

int main() {
    string s;
    cin>>s;
    
    
    rep(i,s.size()){
        if(s[i]=='L'&&(i+1)%2==1){
            cout<<"No"<<endl;
            break;
        }
        if(s[i]=='R'&&(i+1)%2==0){
            cout<<"No"<<endl;
            break;
        }
        else if(i==s.size()-1)) {
            cout<<"Yes"<<endl;
        }
    }

    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:31: error: expected primary-expression before ')' token
   20 |         else if(i==s.size()-1)) {
      |                               ^
Language: C

#include<stdio.h>
#include<string.h>

int main(void){
char taps[100];
char word1 = "U";
char word2 = "D";
char word3 = "L";
char word4 = "R";
int i = 0,a,sum = 0;
scanf("%s",taps);
//何文字目までループを回せばいいかaに代入させる
a = strlen(*taps);

//偶数番目にlが出た回数と奇数番目にrが出た時にカウントして合計が０なら踏みやすいタップ
//taps[0]が1番目に来る
for(i=0;i<=a;i++){
 if(strcmp(&taps[i],word3) == 0){
  sum = sum + 1;
  i++;
    }
  }
//taps[１]が2番目に来る
  for(i=1;i<=a;i++){
 if(strcmp(&taps[i],word4) == 0){
  sum = sum + 1;
  i++;
    }
  }  
　
if (sum == 0){
     printf("Yes");
 } 
else {
      printf("No"); 
 }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:14: error: initialization of 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
    6 | char word1 = "U";
      |              ^~~
main.c:7:14: error: initialization of 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
    7 | char word2 = "D";
      |              ^~~
main.c:8:14: error: initialization of 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
    8 | char word3 = "L";
      |              ^~~
main.c:9:14: error: initialization of 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
    9 | char word4 = "R";
      |              ^~~
main.c:13:12: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   13 | a = strlen(*taps);
      |            ^~~~~
      |            |
      |            char
In file included from main.c:2:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:18:21: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   18 |  if(strcmp(&taps[i],word3) == 0){
      |                     ^~~~~
      |                     |
      |                     char
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'char'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
main.c:25:21: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   25 |  if(strcmp(&taps[i],word4) == 0){
      |                     ^~~~~
      |                     |
      |                     char
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'char'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
main.c:30:1: error: stray '\343' in program
   30 | <U+3000>
      | ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main(){
    string s;
    cin >> s;
    int n = s,size();
    bool flag = true;
    rep(i, n){
        if(i%2 == 0 && s[i] == 'L') flag == false;
        if(i%2 == 1 && s[i] == 'R') flag == false;
    }
    if(flag) puts("Yes"); else puts("No");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
    9 |     int n = s,size();
      |             ^
      |             |
      |             std::string {aka std::__cxx11::basic_string<char>}
a.cc:9:19: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    9 |     int n = s,size();
      |                   ^~
a.cc:9:19: note: remove parentheses to default-initialize a variable
    9 |     int n = s,size();
      |                   ^~
      |                   --
a.cc:9:19: note: or replace parentheses with braces to value-initialize a variable
Language: C++

#include <iostream>

using namespace std;

int main()
{
    string s;
    cin >> s;

    for (int i = 0 ; i < n ; i++){
        if (((i % 2 == 0)&&(s[i] == 'L'))||((i % 2 == 1)&&(s[i] == 'R'))){cout << "No" <<endl ; return 0;}
    }

    cout << "Yes" <<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: 'n' was not declared in this scope
   10 |     for (int i = 0 ; i < n ; i++){
      |                          ^
Language: Java

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Aim {

    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        String dance = scan.nextLine();

        String[] ki = {"R","U","D"};
        String[] gu = {"L","U","D"};

        boolean g = false;
        for(int i=0;i<dance.length();i++){
            String step = String.valueOf(dance.charAt(i));
            if(!Arrays.asList(g?gu:ki).contains(step)){
                System.out.println("NO");
                return;
            }
            g=!g;
        }
        System.out.println("YES");
    }
}


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

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class ABC141B {

    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        String dance = scan.nextLine();

        String[] ki = {"R","U","D"};
        String[] gu = {"L","U","D"};

        boolean g = false;
        for(int i=0;i<dance.length();i++){
            String step = String.valueOf(dance.charAt(i));
            if(!Arrays.asList(g?gu:ki).contains(step)){
                System.out.println("NO");
                return;
            }
            g=!g;
        }
        System.out.println("YES");
    }
}


Compiler output:
Main.java:5: error: class ABC141B is public, should be declared in a file named ABC141B.java
public class ABC141B {
       ^
1 error
Language: C++

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

int main()
{
	char a[101];
	int len;
	int flag = 0;

	cin >> a;
	len = strlen(a);

	for (int i = 0; i < len; i++) {
		if (i % 2 == 0) {
			if (a[i] == 'L') flag = flag + 1;
		}
		else {
			if (a[i] == 'R') flag = flag + 1;
		}
	}

	if (flag > 0) {
		cout << "No";
	}
	else {
		cout << "Yes";
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'strlen' was not declared in this scope
   12 |         len = strlen(a);
      |               ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
Language: C++

#include <algorithm>
#include <iostream>
#include <math.h>
#define ll long long int
#define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, n)

using namespace std;

int main() {
    string s;
    cin >> s;
    bool odd_flag = true, even_flag = true;
    REP(i, s.length()) {
        if (i % 2 == 0) {
            if (s[i] != 'R' && s[i] != 'U' && s[i] != 'D')
                odd_flag = false;
        } else {
            if (s[i] != 'L' && s[i] != 'U' && s[i] != 'D')
                even_flag = false;
        }
        if (!odd_flag && !even_flag)
            break;
    }
    //cout << odd_flag << " " << even_flag << endl;
    if (odd_flag && s even_flag)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:18: error: no match for 'operator&&' (operand types are 'bool' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   27 |     if (odd_flag && s even_flag)
      |         ~~~~~~~~ ^~ ~
      |         |           |
      |         bool        std::string {aka std::__cxx11::basic_string<char>}
a.cc:27:18: note: candidate: 'operator&&(bool, bool)' (built-in)
   27 |     if (odd_flag && s even_flag)
      |         ~~~~~~~~~^~~~
a.cc:27:18: note:   no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
a.cc:27:22: error: expected ')' before 'even_flag'
   27 |     if (odd_flag && s even_flag)
      |        ~             ^~~~~~~~~~
      |                      )
Language: C++

#include<iostream>
using namespace std;

char S[100];
bool answer;

int main(){
  cin>>S;
  for(int i=0; i<=99; i++){
    if(i%2==0){
      if(S[i]=="R"){
        answer=true;
      }
    }else{
      if(S[i]=="L"){
        answer=true;
      }
    }
  }
  if(answer){
    cout<<"No";
  }else{
    cout<<"Yes";
  }
        

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |       if(S[i]=="R"){
      |          ~~~~^~~~~
a.cc:15:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |       if(S[i]=="L"){
      |          ~~~~^~~~~
a.cc:24:4: error: expected '}' at end of input
   24 |   }
      |    ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: Java

public class Main {
    public static void main(String[] args) {
        try (final Scanner sc = new Scanner(System.in)) {
            final String input = sc.nextLine();
            for (int i = 0; i < input.length(); i++) {
                final char c = input.charAt(i);
                if (i % 2 == 0 && !(c == 'R' || c == 'U' || c == 'D')) {
                    System.out.println("NO");
                    return;
                }
                if (i % 2 == 1 && !(c == 'L' || c == 'U' || c == 'D')) {
                    System.out.println("NO");
                    return;
                }
            }
            System.out.println("YES");
        }
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        try (final Scanner sc = new Scanner(System.in)) {
                   ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        try (final Scanner sc = new Scanner(System.in)) {
                                    ^
  symbol:   class Scanner
  location: class Main
2 errors