Problem:


Score: 200 points

Problem Statement

Takahashi will do a tap dance. The dance is described by a string S where each character is L, R, U, or D. These characters indicate the positions on which Takahashi should step. He will follow these instructions one by one in order, starting with the first character.

S is said to be easily playable if and only if it satisfies both of the following conditions:

Every character in an odd position (1-st, 3-rd, 5-th, \ldots) is R, U, or D.

Every character in an even position (2-nd, 4-th, 6-th, \ldots) is L, U, or D.

Your task is to print Yes if S is easily playable, and No otherwise.

Constraints

S is a string of length between 1 and 100 (inclusive).

Each character of S is L, R, U, or D.

Input

Input is given from Standard Input in the following format:

S

Output

Print Yes if S is easily playable, and No otherwise.

Sample Input 1

RUDLUDR

Sample Output 1

Yes

Every character in an odd position (1-st, 3-rd, 5-th, 7-th) is R, U, or D.

Every character in an even position (2-nd, 4-th, 6-th) is L, U, or D.

Thus, S is easily playable.

Sample Input 2

DULL

Sample Output 2

No

The 3-rd character is not R, U, nor D, so S is not easily playable.

Sample Input 3

UUUUUUUUUUUUUUU

Sample Output 3

Yes

Sample Input 4

ULURU

Sample Output 4

No

Sample Input 5

RDULULDURURLRDULRLR

Sample Output 5

Yes



Sample input:
RUDLUDR


Sample output:
Yes

Submission status: Runtime Error

Solution code:
S=list(input())
E=[]
O=[]
for i in range(len(S)):
  if i%2==0:
    E.append(S[i])
  else:
    O.append(S[i])
if R in E or L in O:
  print("No")
else:
  print("Yes")
S=list(input())
E=[]
O=[]
for i in range(len(S)):
  if i%2==0:
    E.append(S[i])
  else:
    O.append(S[i])
if "R" in E or "L" in O:
  print("No")
else:
  print("Yes")
提出情報

Submission status: Runtime Error

Solution code:
S=list(input())
E=[]
O=[]
for i in range(len(S)):
  if i%2==0:
    E.append(S[i])
  else:
    O.append(S[i])
if R in E or L in O:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
S=input()
O=[]
E=[]
for i in len(S):
  if i%2==0:
    E.append(S[i])
  else:
    O.append(S[i])
if L in O or R in E:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
import sys

number = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
answer = 0

for i in range(number):
    answer += b[a[i]-1]
    
    if i != 0:
        if a[i-1] == a[i]-1:
            answer += c[a[i-1]-1]

print(answer)

Submission status: Runtime Error

Solution code:
S = input()
N = len(S)
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

for i in (0, N, 2):
  if S[i] not in odd:
    ans += 1
for i in (1, N ,2):
  if S[i] not in even:
    ans += 1

if ans == 0:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <math.h>
using namespace std;

int main(){

    int N;
    string S;
    //N=3 abc
    //1<S<100
    //if S[i]!=LorRorUorD
    bool flag=false;
    bool flag2=false;
    cin>>S; //U0D1U2D3U4D5U6D7L8R9
    int i=0;
    //cout << S;
    //0 1 2 3 4 5->１文字目 ２文字目
    //R U D L U D R
    for(i=0;i<S.size();i++){
      if(S[i]=='L' ||S[i]=='R' ||S[i]=='U' ||S[i]=='D'){
        flag=false;
        if(i%2==0 && (S[i]=='R' ||S[i]=='U' ||S[i]=='D') ){
          flag=true;
          //cout << "Yes1";
        }
        else if(i%2!=0 && (S[i]=='L' ||S[i]=='U'||S[i]=='D')) {
          flag=true;
          //cout << "Yes2";
        }
        //cout << flag;
        else{
          flag2=true;
        }
      }
      else{
        flag2=true;
        //cout << "No";
        //exit ;
      }
  }
  if(flag2==true){
    cout << "No";
  }
  else if(flag==true){
    cout << "Yes";
  }

}

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <math.h>
using namespace std;

int main(){

    int N;
    string S;
    //N=3 abc
    //1<S<100
    //if S[i]!=LorRorUorD
    bool flag=false;
    bool flag2=false;
    cin>>S; //U0D1U2D3U4D5U6D7L8R9
    int i=0;
    //cout << S;
    //0 1 2 3 4 5->１文字目 ２文字目
    //R U D L U D R
    for(i=0;i<S.size();i++){
      if(S[i]=='L' ||S[i]=='R' ||S[i]=='U' ||S[i]=='D'){
        flag=false;
        if(i%2==0 && (S[i]=='R' ||S[i]=='U' ||S[i]=='D') ){
          flag=true;
          //cout << "Yes1";
        }
        else if(i%2!=0 && (S[i]=='L' ||S[i]=='U'||S[i]=='D')) {
          flag=true;
          //cout << "Yes2";
        }
        //cout << flag;
        else{
          flag2=true;
        }
      }
      else{
        flag2=true;
        //cout << "No";
        //exit ;
      }
  }
  if(flag2==true){
    cout << "No";
    exit;
  }
  else if(flag==true){
    cout << "Yes";
  }

}

Submission status: Runtime Error

Solution code:
def main(s: str):
    if re.match(r'^([^L][^R])*[^L]$', s):
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    s = input()

    main(s)

Submission status: Runtime Error

Solution code:
s = str(input())
odd = ['R', 'U', 'D]
even = ['L', 'U', 'D']
tmp = 0

for i in range(len(s)):

    if i%2!=0 and s[i] in odd:
       tmp += 1
    elif i%2==0 and s[i] in even:
        tmp += 1

print('Yes' if tmp==len(s) else 'No')

Submission status: Runtime Error

Solution code:
input_tap = input()

for i in range(0,len(input_tap),2):
    if input_tap[i] == 'R' or input_tap[i] == 'U' or input_tap[i] == 'D':
        flag = 'Yes'
    elif input_tap[i+1] == 'R' or input_tap[i+1] == 'U' or input_tap[i+1] == 'D':
        flag = 'Yes'
    else:
        flag = 'No'
print(flag)

Submission status: Runtime Error

Solution code:
s=input()
ng=False
for i in range(n):
  if i%2==0:
    if s[i]=='R':
      ng=True
  else:
    if s[i]=='L':
      ng= True
if ng:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
s=input()
ng=False
for i in range(n):
  if i%2=0:
    if s[i]=='R':
      ng=True
  else:
    if s[i]=='L':
      ng= True
if ng:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
N=list(input())
a=[]
b=[]
#print(N)
#print(len(N))
for k in range(len(N)+1):
    if k%2>0:
        a.append(N[k])
    else:
        b.append(N[k])
if   a.count('L')==0 and b.count('R')==0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
array = ['L','R','U','D']
s = input()
c = 0
for i in range(len(s)):
  if i%2 == 0:
    if s[i] = 'L' or s[i] = 'U' or s[i] = 'D':
      continue
    else:
      c = 1
  if i%2 == 1:
    if s[i] = 'R' or s[i] = 'U' or s[i] = 'D':
      continue
    else:
      c = 1
if c== 0:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
 import re

s = input()
p = re.compile(r'^([^L][^R])*[^L]?$')
if p.match(s):
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
 import re
 s = input()
 p = re.compile(r'^([^L][^R])*[^L]?$')
 if p.match(s):

 print("Yes")
 else:
 print("No")

Submission status: Runtime Error

Solution code:
S = input()
c = 0
for i in range(50):
  if S[2*i] == 'R' or S[2*i] == 'U' or S[2*i] == 'D':
    continue
  else:
    c = 1
for j in range(49):
  if S[2*j+1] == 'L' or S[2*j+1] == 'U' or S[2*j+1] == 'D':
    continue
  else:
    c = 1
if c == 1:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S=input()
y="Yes"
n="No"
for i in range(len(S)):
    if i%2==1:
        if S[i] in {"L","U","D"} and S[i-1] in {"R","U","D"} and S[len(S)-1] in {"R","U","D"}:
            ans=y
        else:
            ans=n
    else:
        continue
print(ans)

Submission status: Runtime Error

Solution code:
S=input()
y="Yes"
n="No"
for i in range(len(S)-1):
    if i%2==1:
        if S[i] in {"L","U","D"} and S[i-1] in {"R","U","D"} and S[len(S)-1] in {"R","U","D"}:
            ans=y
        else:
            ans=n
    else:
        continue
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
if len(s)%2==0:
  for i in range(len(s)//2):
    if s[2*i]!='R' and s[2*i]!='U' and s[2*i]!='D' :
      print('No')
      exit()
    if s[2*i+1]!='L' and s[2*i+1]!='U' and s[2*i+1]!='D':
      print('No')
      exit()
if len(s)%2==1:
  for i in range(len(s)//2+1):
    if s[2*i+1]!='L' and s[2*i+1]!='U' and s[2*i+1]!='D':
      print('No')
      exit()
    if s[2*i]!='R' and s[2*i]!='U' and s[2*i]!='D' :
      print('No')
      exit()
print('Yes')

Submission status: Runtime Error

Solution code:
s=input()
for i in range(len(s)//2+1):
  if s[2*i]!='R' and s[2*i]!='U' and s[2*i]!='D' :
    print('No')
    exit()
for i in range(len(s)//2):
  if s[2*i+1]!='L' and s[2*i+1]!='U' and s[2*i+1]!='D':
    print('No')
    exit()
if len(s)%2==1:
  if s[-1]!='L' and s[-1]!='U' and s[-1]!='D':
    print('No')
    exit()
print('Yes')

Submission status: Runtime Error

Solution code:
s=input()
for i in range(len(s)//2+1):
  if s[2*i]!='R' and s[2*i]!='U' and s[2*i]!='D' :
    print('No')
    exit()
  if s[2*i+1]!='L' and s[2*i+1]!='U' and s[2*i+1]!='D':
    print('No')
    exit()
if 
print('Yes')

Submission status: Runtime Error

Solution code:
s = input()
for i, c in enumerate(s):
    if i % 2 == 0 and c == 'R':
        yes = False
    elif i % 2 == 1 and c == 'L':
        yes = False
if yes:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
S = int()
N = len(S)
n = N // 2
ans = 'tes'
for i in range(n):
    p = S[2*i]
    q = S[2*i+1]
    if p == 'L':
        ans = 'No'
    if q == 'R':
        ans = 'No'
if N % 2 == 1:
    if S[N-1] == 'L':
        ans = 'No'
print(ans)

Submission status: Runtime Error

Solution code:
li = list(input())

for i in range(len(li)):
    if i % 2 == 0:
        if len[i] == "R":
            print("No")
            quit()
    else:
        if len[i] == "L":
            print("No")
            quit()
print("Yes")

Submission status: Runtime Error

Solution code:
li = list(input())

for i in range(len(li)):
    if i % 2 == 0:
        if len[i] = "R":
            print("No")
            quit()
    else:
        if len[i] = "L":
            print("No")
            quit()
print("Yes")

Submission status: Runtime Error

Solution code:
def inpl():
    return list(map(int, input().split()))


S = input()

p = re.compile(r'([^L][^R])*[^L]?$')

if p.match(S):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
import sys
S = str(input())
n = len(S)
for i in range(n):
    if S[i] == "U" or "D":
        if (S[i%2 == 1] and S[i%2 == 1] == "R") or (S[i%2 == 0] and S[i%2 == 0] == "L"):
            print("Yes")
            sys.exit()
        else:
            print("No")
            sys.exit()
    else:
        print("No")
        sys.exit()

Submission status: Runtime Error

Solution code:
import sys
S = str(input())
n = len(S)
for i in range(n):
    if S[i] == "U" or "D":
        if (S[i%2 == 1] and S[i%2 == 1] == "R") or (S[i%2 == 0] and S[i%2 == 0] == "L"):
            print("Yes")
            sys.exit()
        else:
            print("No")
            sys.exit()

Submission status: Runtime Error

Solution code:
S=input()
y="Yes"
n="No"
for i in range(len(S)-1):
    if i%2==1:
        if S[i]=={"L","U","D"} and S[i-1]=={"R","U","D"} and S[len(S)-1]=={"R","U","D"}:
            ans=y
        else:
            ans=n
    else:
        continue
print(ans)

Submission status: Runtime Error

Solution code:
s=str(input())
even = ["L". "U", "D"]
odd = ["R", "U", "D"]
a = []
b = []
for i in range(len(str)):
     if i%2 == 0:
            if s[i] in even:
                a.apend(True) 
            else:
                a.apend(False)
     elif i%2 i= 0:
            if s[i] in odd:
                b.apend(True) 
            else:
                b.apend(False)
if all(a) and all(b):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
S=input()
y="Yes"
n="No"
for i in range(len(S)-1):
    if i%2==1:
        if S[i]=={"L","U","D"} and S[i-1]=={"R","U","D"}:
            ans=y
        else:
            ans=n
    else:
        continue
print(ans)

Submission status: Runtime Error

Solution code:
s = list(str(input()))
for i in range(1, len(s)+1):
  if ((i+1)%2 and s[i]=='L') or ((i+1)%2==0 and s[i]=='R'):
    print('No')
    exit()
print('Yes')

Submission status: Runtime Error

Solution code:
s = list(str(input()))
for i in range(1, len(s)+1):
  if (i%2 and s[i]=='L') or (i%2==0 and s[i]=='R'):
    print('No')
    exit()
print('Yes')

Submission status: Runtime Error

Solution code:
s = list(str(input()))
for i in range(1, len(s)+1):
  if (i%2 and s[i]=='L') or (i%2==0 and s[i]=='R'):
    print('No')
 	exit()
print('Yes')

Submission status: Runtime Error

Solution code:
for j in range(len(s)):
    if j % 2 == 0 and s[j] == "L":
        print("No")
        break
    elif j % 2 == 1 and s[j] == "R":
        print("No")
        break
    elif j == len(s) -1:
        print("Yes")

Submission status: Runtime Error

Solution code:
s = input()

res = True
for i in range(lens(s)):
  if i % 2 == 0 and s[i] == 'L':
    res = False
    break
  if i % 2 == 1 and s[i] == 'R':
    res = False
    break

if res:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
s=list(input())
l=len(s)
for i  in range(0,l):
  if i%2==0:
    if s[i]=="R":
      print("No")
      exit()
  if i%2==1:
    if s[i]=="L":
      pirnt("No")
      exit()
print("Yes")

Submission status: Runtime Error

Solution code:
import sys


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


# A
def A():
    s = input()
    if s == "Sunny":
        print("Cloudy")
    elif s == "Cloudy":
        print("Rainy")
    else:
        print("Sunny")
    return


# B
def B():
    s = S()
    for i in range(len(s))
        if i % 2:
            if s[i] not in ["L", "U", "D"]:
                print("No")
                return
        else:
            if s[i] not in ["R", "U", "D"]:
                print("No")
                return
    print("Yes")
    return


# C
def C():
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# Unittest
def resolve():
    B()
    return


# Solve
if __name__ == "__main__":
    B()

Submission status: Runtime Error

Solution code:
S=input()
s=list(S)

odd=[]
even=[]

for i in range(n):
  if i%2==0:
    odd.append(s[i])
  if i%2==1:
    even.append(s[i])

    
oddsum=0
evensum=0

for i in range(len(odd)):
  if odd[i]=="R" or odd[i]=="U" or odd[i]=="D":
    oddsum+=1
  else:
    oddsum+=0

for i in range(len(even)):
  if even[i]=="L" or even[i]=="U" or even[i]=="D":
    evensum+=1
  else:
    evensum=0

if oddsum==len(odd) and evensum==len(even):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
strs = input()
 
for i in range(len(strs)):
  if !(i % 2 == 0):
    if (strs[i] == "L") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
  else:
    if (strs[i] == "R") or (strs[i] == "U") or (strs[i] == "D"):
      continue
    else:
      print("No")
      break
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
strs = input()

for str in strs:
  if i % 2 == 0:
    if (i == "L") or (i == "U") or (i == "D"):
      continue
    else:
      print("No")
      break
  else:
    if (i == "R") or (i == "U") or (i == "D"):
      continue
    else:
      print("No")
      break
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
s=input()
x=0
for i in range(0,len(s),2):
  if s[i]="L":
    x+=1
    
for j in range(1,len(s),2):
  if s[j]="R":
    x+=1

if x==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
s=list(map(input().split()))
x=0
for i in range(0,len(s),2):
  if s[i]="L":
    x+=1
    
for j in range(1,len(s),2):
  if s[j]="R":
    x+=1

if x==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
S=list(input())
a=0
for j in range(0,len(S),2):
    if S[i]=="R" or S[i]=="U" or S[i]=="D":
        a+=1
for i in range(1,len(S),2):
    if S[i]=="L" or S[i]=="U" or S[i]=="D":
        a+=1
if a==len(S):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
S=list(input())
a=0
for i in range(1,len(S),2):
    if S[i]=="L" or S[i]=="U" or S[i]=="D":
        a+=1
for j in range(0,len(S),2):
    if S[i]=="R" or S[i]=="U" or S[i]=="D":
        a+=1
if a==len(S):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
S=list(input())
a=0
for i in range(1,len(S),2):
    if S[i]=="R" or S[i]=="U" or S[i]=="D":
        a+=1
for j in range(0,len(S),2):
    if S[i]=="L" or S[i]=="U" or S[i]=="D":
        a+=1
if a==len(S):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
S=list(input())
a=0
for i in range(1,len(S),2):
    if S[i]=="L" or S[i]=="U" or S[i]=="D":
        a+=1
for j in range(0,len(S),2):
    if S[i]=="L" or S[i]=="U" or S[i]=="D":
        a+=1
if a==len(S):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
S=input()
i=0
while i<len(S):
  if i%2=0:
    if S[i]=="L":
      print("No")
      exit()
    else:
      i+=1
  else:
    if S[i]=="R":
      print("No")
    else:
      i+=1
print("Yes")

Submission status: Runtime Error

Solution code:
S = input()

s = len(S)
a = 0
b = 0
if s%2 == 0:
  a += s//2
  for i in range(a):
    if S[2*i] == "L":
      print("No")
      break
    b += 1
  for i in range(a-1):
    if S[2*i+1] == "R":
      print("No")
      break
    b += 1
else:
  a += (s+1)//2
  for i in range(a):
    if S[2*i] == "L":
      print("No")
      break
    b += 1
  for i in range(a):
    if S[2*i+1] == "R":
      print("No")
      break
    b += 1

if b == s:
  print("Yes")

Submission status: Runtime Error

Solution code:
S = input()

s = len(S)
a = 0
b = 0
if s%2 == 0:
  a += s//2
else:
  a += (s+1)//2

for i in range(a):
  if S[2*i+1] == "L":
    print("No")
    break
  if S[2*i] == "R":
    print("No")
    break
  b += 1
if b == s:
  print("Yes")

Submission status: Runtime Error

Solution code:
S = input()

s = len(S)
a = 0
if s%2 == 0:
  a += s//2
else:
  a += (s+1)//2

for i in range(a):
  if S[2*i+1] == "L":
    print("No")
    break
  if S[2*i] == "R":
    print("No")
    break
  a += 1
if a == s:
  print("Yes")

Submission status: Runtime Error

Solution code:
S=input()
flag = True
 
for i in range(len(S)):
  if i%2==0 and S[i] == R:
    print('No')
    flag = False
    break
  elif i%2==1 and S[i] == L:
    print('No')
    flag = False
    break
if flag:
  print('Yes')

Submission status: Runtime Error

Solution code:
S=input()
flag = True

for i in range(len(a)):
  if i%2==0 and S[i] == R:
    print('No')
    flag = False
    break
  elif i%2==1 and S[i] == L:
    print('No')
    flag = False
    break
if flag:
  print('Yes')

Submission status: Runtime Error

Solution code:
S = input()

s = len(S)
a = 0
if s%2 == 0:
  a += s//2
else:
  a += (s+1)//2

for i in range(a):
  if S[2*i+1] == "L":
    print("No")
    break
  if S[2*i] == "R":
    print("No")
    break
print("Yes")

Submission status: Runtime Error

Solution code:
S = input()

s = len(S)
a = 0
if s&2 == 0:
  a += s//2
else:
  a += (s+1)//2

for i in range(a):
  if S[2*i+1] == "L":
    print("No")
    break
  if S[2*i] == "R":
    print("No")
    break
print("Yes")

Submission status: Runtime Error

Solution code:
S=input()

p=True
q=True
for i in S:
  if p:
    if not i=='L':
      p=False
	else:
      q=False
      break
  else:
    if not i=='R':
      p=True
    else:
      q=False
      break
      
print ("Yes" if q else "No")

Submission status: Runtime Error

Solution code:
S = list(map(str, input()))
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] == "L":
      unreadble += 1
  else:
    if S[i] == "R":
  	  unreadble += 1
if unreadble >= 1:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
S = list(map(str, input()))
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] == "L":
      print("No")
  else:
    if S[i] == "R":
      print("No")
print("Yes)

Submission status: Runtime Error

Solution code:
S = str(input())
odd = ""
even = ""
flag=0
for i in range(len(S)):
  if i % 2 == 0:
    odd += S[i]
  else:
    even += S[i]    
odd = list(set(odd))
even = list(set(even))

if len(odd) <= 3 and len(even) <= 3:
  for i in range(len(odd)):
    if (odd[i] == 'R') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  for i in range(len(even)):
    if (odd[i] == 'L') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  if flag==0:
    print('Yes')
  elif flag==1:
    print('No')
else:
  print('No')

Submission status: Runtime Error

Solution code:
S = str(input())
odd = ""
even = ""
flag=0
for i in range(len(S)):
  if i % 2 == 0:
    odd += S[i]
  else:
    even += S[i]    
odd = list(set(odd))
even = list(set(even))
if len(odd) <= 3 and len(even) <= 3:
  for i in range(len(odd)):
    if (odd[i] == 'R') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  for i in range(len(even)):
    if (odd[i] == 'L') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  if flag==0:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Runtime Error

Solution code:
S = str(input())
odd = ""
even = ""
flag=0
for i in range(len(S)):
  if i % 2 == 0:
    odd += S[i]
  else:
    even += S[i]    
odd = list(set(odd))
even = list(set(even))
if len(odd) <= 3 and len(even) <= 3:
  for i in range(len(odd)):
    if (odd[i] == 'R') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  for i in range(len(even)):
    if (odd[i] == 'L') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  if flag=0:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Runtime Error

Solution code:
S = str(input())
odd = ""
even = ""
flag=0
for i in range(len(S)):
  if i % 2 == 0:
    odd += S[i]
  else:
    even += S[i]    
odd = list(set(odd))
even = list(set(even))
if len(odd) == 3 and len(even) == 3:
  for i in range(len(odd)):
    if (odd[i] == 'R') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  for i in range(len(even)):
    if (odd[i] == 'L') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  if flag=0:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Runtime Error

Solution code:
S = str(input())
odd = ""
even = ""
flag=0
for i in range(len(S)):
  if i % 2 == 0:
    odd += S[i]
  else:
    even += S[i]    
odd = list(set(odd))
even = list(set(even))
if len(odd) == 3 and len(even) == 3:
  for i in range(len(odd)):
    if (odd[i] == 'R') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  for j in range(len(even)):
    if (odd[i] == 'L') or (odd[i] == 'U') or (odd[i] == 'D'):
      pass
    else:
      flag=1
  if flag=0:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Runtime Error

Solution code:
s = list(map(int, input()))
for i in range(len(s)):
    if i%2 == 0 and s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
        bool = True
    elif i%2 == 1 and s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
        bool = True
    else:
        bool = False
        break
        
if bool == True:
    print('Yes')
elif bool == False:
    print('No')

Submission status: Runtime Error

Solution code:
s = input()
 
for i in range(len(s))
	if i%2==0 and s[i]=='R':
    	print('No')
    	exit()
    elif i%2==1 and s[i]=='L':
    	print('No')
    	exit()
 
print('Yes')

Submission status: Runtime Error

Solution code:
s = input()
 
for i in range(len(s))
	if i%2==0 and s(i)=='R':
    print('No')
    exit()
    elif i%2==1 and s(i)=='L':
    print('No')
    exit()

print('Yes')

Submission status: Runtime Error

Solution code:
s = input()

for i in range(len(s))
	if i%2==0 and s(i)=='R':
    print('No')
    exit
    elif i%2==1 and s(i)=='L':
    print('No')
    exit
print('Yes')

Submission status: Runtime Error

Solution code:
n= list(input())
print('No' if 'L' in n[::2] or 'R' in n[1::2] else 'Yes)

Submission status: Runtime Error

Solution code:
S=list(input())

K="Yes"

for i in range (0,len(S)):
	if i%2=0
	    if S[i]=="L" :
        	K="No"
        	break
        else:
        	continue
    else :
		if S[i]=="R" :
        	K="No"
        	break
    	else:
        	continue
print(K)

Submission status: Runtime Error

Solution code:
S=list(input())
q=len(S)//2+1
i=0
K="Yes"
for i in range (0,q):
    if S[2*i]=="L":
        K="No"
        break
    elif S[2*i+1]=="R":
        K="No"
        break
    else:
        continue
print(K)

Submission status: Runtime Error

Solution code:
s = list(input())

for i in range(len(s)-1):
    if s[2i+１]=="R" or s[2i+１]=="U" or s[2i+１]=="D" :
        if s[2i]=="L" or  s[2i]=="U" or s[2i]=="D":
            print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
s = list(input())

for i in range(len(s)-1):
    if s[2i+１]=="R" or [2i+１]=="U" or [2i+１]=="D" :
        if s[2i]=="L" or  s[2i]=="U" or s[2i]=="D":
            print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
for i in range(len(s)-1)
    if s[2i+１]=="R" or [2i+１]=="U" or [2i+１]=="D" :
        if s[2i]=="L" or  s[2i]=="U" or s[2i]=="D":
            print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
s = list(input())

for i in range(len(s))
    if s[2i+１]=="R" or [2i+１]=="U" or [2i+１]=="D" :
        if s[2i]=="L" or  s[2i]=="U" or s[2i]=="D":
            print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
S = input()
lis = list(S)


for i in range(len(lis)):
    if i % 2 == 0:
        if lis[i] == 'R' or lis[i] == 'U' or lis[i] == 'D':
            flag_o = 1
        else:
            flag_o = 0
            break
    if i % 2 != 0:
        if lis[i] == 'L' or lis[i] == 'U' or lis[i] == 'D':
            flag_e = 1
        else:
            flag_e = 0
            break
        
if flag_o == 1 and flag_e == 1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
S = input()
lis = list(S)

for i in range(len(lis)):
    if i % 2 == 0:
        if lis[i] == 'R' or lis[i] == 'U' or lis[i] == 'D':
            flag_o = 1
        else:
            flag_o = 0
            break
    if i % 2 != 0:
        if lis[i] == 'L' or lis[i] == 'U' or lis[i] == 'D':
            flag_e = 1
        else:
            flag_e = 0
            break
        
if flag_o == 1 and flag_e == 1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
a=input()
i=0
while(i<len(a)):
    if(i%2==0):
        if a[i]=="R" or "U" or "D":
            i=i+1
        else:
            print("No")
            return
    else:
        if a[i]=="L" or "U" or "D":
            i=i+1
        else:
            print("No")
            return
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

S = str(input())

cnt = 0
N = int(len(S)/2)
for i in range(N):
    if(S[0]=='L'):
        break
    if(S[2*i+2]=='L'):
        break
    if(S[2*i+1]=='R'):
        break
    else:
        cnt+=1
if(cnt==N):
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:

s = input()
i = 0
while i < 100 and i < len(s):
    if s[i] != "R" and s[i] != "U" and s[i] != "D":
        print(i)
        print(s[i])
        print("1No")
        sys.exit()
    i += 2
i = 1
while i < 100 and i < len(s):
    if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
        print(s[i])
        print("2No")
        sys.exit()
    i += 2

print("Yes")

Submission status: Runtime Error

Solution code:
for i in S[::2]:
  if i == "L":
    A = False   
for x in S[1::2]:
  if x == "R":
    A = False

if A:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == "R" or "U" or "D":
      continue
   	else:
      print("No")
      exit()
  else:
    if S[i] == "L" or "U" or "D":
      continue
    else:
      print("No")
      exit()
print("Yes")

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if (S[i] == "R") or(S[i] ==  "U") or(S[i] ==  "D"):
    	continue
   	else:
    	print("No")
      	exit()
  else:
  	if (S[i] == "R") or(S[i] ==  "U") or(S[i] ==  "D"):
    	continue
    else:
    	print("No")
      	exit()
print("Yes")

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == ("R" or "U" or "D"):
    	continue
   	else:
    	print("No")
      	exit()
  else:
  	if S[i] == ("L" or "U" or "D"):
    	continue
    else:
    	print("No")
      	exit()
print("Yes")

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == ("R" or "U" or "D"):
      continue
   	else:
      print("No")
      exit()
  else:
    if S[i] == ("L" or "U" or "D"):
      continue
    else:
      print("No")
      exit()
print("Yes")

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if S[i] == "R" or "U" or "D":
      continue
   	else:
      print("No")
      exit()
  if i % 2 != 0:
    if S[i] == "L" or "U" or "D":
      continue
    else:
      print("No")
      exit()
print("Yes")

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if s[i] == "R" or "U" or "D":
      pass
   	else:
      print("No")
      exit()
  else:
    if s[i] == "L" or "U" or "D":
      pass
    else:
      print("No")
      exit()
print("Yes")

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if s[i] == "R" or "U" or "D":
      continue
   	else:
      print("No")
      exit()
  else:
    if s[i] == "L" or "U" or "D":
      continue
    else:
      print("No")
      exit()
print("Yes")

Submission status: Runtime Error

Solution code:
S = list(input())
total = 0
for i in range(len(S)):
  if i % 2 == 0:
   	if s[i] == "R" or "U" or "D":
      continue
   	else:
      total += 1
  else:
    if s[i] == "L" or "U" or "D":
      continue
    else:
      total += 1
  
if total > 0:
  print("No")
else:  
  print("Yes")

Submission status: Runtime Error

Solution code:
S = list(input())
for i in range(len(S)):
  if i % 2 == 0:
   	if s[i] == "R" or "U" or "D":
      continue
   	else:
      print("No")
      break
  else:
    if s[i] == "L" or "U" or "D":
      continue
    else:
      print("No")
      break
  print("Yes")

Submission status: Runtime Error

Solution code:
S = input()
res = "Yes"
for x in range(int(len(S)/2)+1):
  if S[2*x] not in ["R","U","D"]:
    res = "No"
  if 2*x + 1 < len(S):
    if S[2*x+1] not in ["L","U","D"]:
      res = "No"
print(res)

Submission status: Runtime Error

Solution code:
s = list(input())
for i in range(len(s)):
  if i % 2 == 0:
    if not s[i] in "RUD":
      print ("No") 
      exit() 
  else: 
    if nit s[i] in "LUD":
      print("No")
      exit()
print("Yes")

Submission status: Runtime Error

Solution code:
s = list(input())
for i in range(len(s)):
  if i % 2 == 0:
    if not s[i] in "RUD":
      print ("No") 
      exit() 
  else: 
    if not s[i] in "LUD":
      print("No")
      exit()
print("Yes"