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: Wrong Answer

Solution code:
S = input()
flag = 1
i = 0
while(i<len(S)):
    if((S[i]=="L" or S[i]=="U" or S[i]=="D") and (S[i-1]=="R" or S[i-1]=="U" or S[i-1]=="D")):
        flag = 1 
    else:
        flag = 0
        break;
    i+=2
if(flag==0):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
tap = input()
ans = 'YES'
for i in range(1,len(tap)):
  if i%2 == 0:
    if tap[i-1] == 'R':
      ans = 'NO'
      break
  else:
    if tap[i-1] == 'L':
      ans = 'NO'
      break
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
flag = 1
i = 0
while(i<len(S)):
    if((S[i]=="R" or S[i]=="U" or S[i]=="D") and (S[i-1]=="L" or S[i-1]=="U" or S[i-1]=="D")):
        flag = 1 
    else:
        flag = 0
        break;
    i+=2
if(flag==0):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = list(input())
cnt = True
cnt_1=True
s_even = s[0::2]
s_odd = s[1::2]
for i in range(len(s_even)):
    if s[i] == 'R':
        cnt = False
    else:
        cnt = True
for i in range(len(s_odd)):
        if s[i] =='L':
            cnt_1 =False
        else:
            cnt_1 =True
            
if cnt ==True  and cnt_1 ==True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=str(input())
hantei0=True
hantei1=True

for i in range(len(s)):
  if i%2==0 and s[i]=='L':
    print(i,s[i])
    hantei0=False
  elif i%2==1 and s[i]=='R':
    hantei1=False
    
if hantei0==True and hantei1==True:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = list(input())
i = 0
for s in S:
    c = S.index(s)+1
    if ((c%2 == 0 and ((s=="L")or(s=="U")or(s=="D"))) or (c%2 !=0 and ((s=="R")or(s=="U")or(s=="D")))):
        i +=1
        if i == len(S):
            print("Yes")
    else:
        print("No")
        break

Submission status: Wrong Answer

Solution code:
dance = input()
num = 0
odd = []
even = []
for i in dance:
    num += 1
    if num %2 == 0:
        even.append(i)
    else:
        odd.append(i)
try:
    if (even.index('R') == True) or (odd.index('L') == True):
        print('No')
except ValueError:
    print('Yes')

Submission status: Wrong Answer

Solution code:
str_s = input()

kisuu = [n for i, n in enumerate(str_s) if (i+2) % 2 == 0]
gusuu =  [n for i, n in enumerate(str_s) if (i+1) % 2 == 0]

ret = []

for n in kisuu:
    if n not in ("R", "U", "D"):
        print("No")
        ret.append(False)
        break
else:
    ret.append(True)


for n in gusuu:
    if n not in ("L", "U", "D"):
        print("No")
        ret.append(False)
        break
else:
    ret.append(True)


if all(ret):
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
b1 = False
b2 = False
for index in range(1,len(s)+1):
    i = s[index-1]
    if index % 2 == 0:
        if  i  == "L" or i == "U" or i == "D":
            b1 = True
        else:
            b1 = False
    else:
        if i  == "R"  or i == "U" or i == "D":
            b2 = True
        else:
            b2 = False
if b1 and b2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        for line in sys.stdin:
            lines.append(line)
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    s = lines[0]

    return (s, )


def solve(s, ):

    result = 'Yes'
    for i in range(len(s)):
        if i % 2 == 0:
            if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
                pass
            else:
                result = 'No'

        if i % 2 == 1:
            if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
                pass
            else:
                result = 'No'


    return result


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r)
    else:
        print("%s" % result)

if __name__ == '__main__':

    main()

Submission status: Wrong Answer

Solution code:
S = input()
result = "Yes"
for i in range(0,len(S)-1):
    if i % 2 == 0:
        if S[i] == "L":
            result = "No"
    elif i % 2 != 0:
        if S[i] == "R":
            result = "No"

print(result)

Submission status: Wrong Answer

Solution code:
S = list(input())

result = "Yes"

if S[0::2] == "L":
    result = "No"
elif S[1::2] =="R":
    result = "No"

print(result)

Submission status: Wrong Answer

Solution code:
Dance = input()

import re

pattern1 = r"[^RUD]"
pattern2 = r"[^LUD]"

if re.search(pattern1, Dance[0::2]) and re.search(pattern2, Dance[1::2]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
dance = input()
num = 0
odd = []
even = []
for i in dance:
    num += 1
    if num %2 == 0:
        even.append(i)
    else:
        odd.append(i)
try:
    if (even.index('R') == True):
        print('No')
except ValueError:
    try:
        if odd.index('L') == True:
            print('No')
    except ValueError:
        print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
ans = 'Yes'
for i in range(len(s)):
  if i%2 == 0:
    if s[i] == 'R':
      ans = 'No'
      break
  else:
    if s[i] == 'L':
      ans = 'No'
      break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

s = list(s)
s1=s[0::2]
s2=s[1::2]

flag = "yes"

for a in s1:
  if (a != 'R') and (a != 'U') and (a != 'D'):
    flag = "no"
for a in s2:
  if (a != 'L') and (a != 'U') and (a != 'D'):
    flag = "no"

print(flag)

Submission status: Wrong Answer

Solution code:
S = input()
result = "No"
for i in range(0,len(S)-1):
    if i % 2 == 0:
        if S[i] != "L":
            result = "Yes"
        else:
            result = "No"
            break
    elif i % 2 != 0:
        if S[i] != "R":
            result = "Yes"
        else:
            result = "No"
            break

print(result)

Submission status: Wrong Answer

Solution code:
S = list(input())

result = "No"

if S[0::2] =="R"and"U"and"D":
    result = "Yes"
elif S[1::2] =="L"and"U"and"D":
    result = "Yes"

print(result)

Submission status: Wrong Answer

Solution code:
a=input()
print(a)
b=0
for k,i in enumerate(a):
  if k%2==0:
    if i=="L":
      b=1
      break
  else:
    if i=="R":
      b=1
      break
if b==0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
n = str(input())
d = []
p = []
i = 1
s = 1
l = 1
for k in n:
 if i % 2 == 0:
  if k == "L" or k == "U" or k == "D":
   pass
  else:
   s = 0
 else:
  if k == "R" or k == "U" or k == "D":
   pass
  else:
    l = 0
 i = i + 1
if s and l == "1":
 print("Yes")
else:
 print("No")

Submission status: Wrong Answer

Solution code:
steps = list(list(input()))
even = True
odd = True
for i in range(0, len(steps), 2):
    if not (steps[i] == 'U' or  steps[i] == 'U' or  steps[i] == 'D'):
        odd = False

for i in range(1, len(steps), 2):
    if not (steps[i] == 'L' or  steps[i] == 'U' or  steps[i] == 'D'):
        even = False

if even and odd:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
input_line = input()

def check():
  for i in input_line:
      num = input_line.index(i)
      if (num + 1) % 2 == 1 and i == 'R' or i == 'U' or i == 'D':
          pass
      elif num % 2 == 0 and i == 'L' or i == 'U' or i == 'D':
          pass
      elif (num + 1) % 2 == 1 and i == 'L':
          print('No')
          break
      elif num % 2 == 0 and i == 'R':
          print('No')
          break
print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()

Odd= S[0::2]
Even= S[1::2]

oddset  = {'R', 'U', 'D'}
evenset = {'L', 'U', 'D'}

if set(Odd)==oddset and set(Even)==evenset:
    ans = 'Yes'
else :
    ans = 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
text = list(input())

text_1, text_2 = list(text), list(text)
for i in range(int(len(text)/2)):
    text_1.pop(i)
    text_2.pop(i+1)
str_1, str_2 = "", ""
for i in range(len(text_1)):
    str_1 += text_1[i]
for i in range(len(text_2)):
    str_2 += text_2[i]

if str_1.find('L') == -1 and str_2.find('R') == -1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

kisu = ['R', 'U', 'D']
gusu = ['L', 'U', 'D']

hard = 0
S = "RDULULDURURLRDULRLR"

for i in range(len(S)):
    moji = S[i]
    if i % 2 == 1:
#        print("{} th : {} is in  Kisu(R,U,D)".format(i,moji))
        if moji not in gusu:
            hard = 1
            break
        else:
            hard = 0
    if i % 2 == 0:
#        print("{} th : {} is in Gusu(L,U,D)".format(i,moji))
        if moji not in kisu:
            hard = 1
            break
        else:
            hard = 0
if hard == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    S = input()
    ans = "Yes"
    for i in range(len(S)):
        if (i+1) % 2 == 1:
            if S[i] is "R" or S[i] is "U" or S[i] is "D":
                pass
            else:
                ans = "No"
        else:
            if S[i] is "L" or S[i] is "U" or S[i] is "D":
                pass
            else:
                ans = "No"
        if ans == "No":
            print("No")
            exit()
    print("Yes")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = list(input())
cnt = True
cnt_1=True
s_even = s[0::2]
s_odd = s[1::2]
for i in range(len(s_even)):
    if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
        cnt = True
    else:
        cnt = False
for i in range(len(s_odd)):
        if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
            cnt_1 =True
        else:
            cnt_1 =False
            
if cnt ==True  and cnt_1 ==True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = str(input())

A = ['Yes','No']
k = 0
glist = ['R','U','D']
klist = ['L','U','D']

for i in range(len(S)-1):
    if i%2 == 0:
        if S[i] == 'L':
            k = 1
            break
    else:
        if S[i] == 'R':
            k = 1
            break

print(A[k])

Submission status: Wrong Answer

Solution code:
s = list(input())

k = sorted(set(s[0::2]))
g = sorted(set(s[1::2]))

if 'R' in k and 'L' in g:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N=list(input())
#print(N)
x=len(N)
y="YES"
for i  in range(x):
	if i%2==1:
		if N[i]=="R" :
			y="No"
			break
	if i%2==0:
		if N[i]=="L":
			y="No"
			break
print(y)

Submission status: Wrong Answer

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

import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        for line in sys.stdin:
            lines.append(line)
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    s = lines[0]

    return (s, )


def solve(s, ):

    result = 'Yes'
    for i in range(0, len(s), 2):
        if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
            pass
        else:
            result = 'No'

    for i in range(1, len(s), 2):
        if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
            pass
        else:
            result = 'No'


    return result


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r)
    else:
        print("%s" % result)

if __name__ == '__main__':

    main()

Submission status: Wrong Answer

Solution code:
S = input()

for i in range(0,int(len(S)/2)):
	if S[i * 2] == "L": #奇数
		print("No")
		break
	elif S[i * 2 + 1] == "R":
		print("No")
		break
else:print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input())

result = "No"

if S[0::2] =="L"or"U"or"D":
    result = "Yes"
elif S[1::2] =="R"or"U"or"D":
    result = "Yes"

print(result)

Submission status: Wrong Answer

Solution code:
import numpy as np
S = list(map(str,input().split()))
S = [c for c in S[0]]

result = 0
print(S)
for i in range(len(S)):
    if (i % 2 == 1) and ((S[i] == 'L') or (S[i] == 'U') or (S[i] == 'D')):
        result += 1
    if (i % 2 == 0) and ((S[i] == 'R') or (S[i] == 'U') or (S[i] == 'D')):
        result += 1
        
if result == len(S):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
g = ['R', 'U', 'D']
k = ['L', 'U', 'D']
a = input()
b = 0
for i in range(len(a)):
    if (i+1) % 2 == 0:
        if a[i] in g:
            pass
        else:
            print('No')
            b = 1
            break
    else:
        if a[i] in k:
            pass
        else:
            print('No')
            b = 1
            break
if b == 0:
    print('Yes')

Submission status: Wrong Answer

Solution code:
s = list(input())
cnt = True
s_even = s[0::2]
s_odd = s[1::2]
for i in range(len(s_even)):
    if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
        cnt = True
    else:
        cnt = False
for i in range(len(s_odd)):
        if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
            cnt =True
        else:
            cnt =False
            
if cnt ==True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s=list(input())
if not("L" in s[::2]):
  if not("R" in s[1::2]):
    print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l = ['L', 'R', 'U', 'D']
s = list(input())
ans = 'YES'
for i in range(len(s)):
  if i % 2 == 0:
    if s[i] == 'L':
      ans = 'NO'
      break
  if i % 2 == 1:
    if s[i] == 'R':
      ans = 'NO'
      break
print(ans)

Submission status: Wrong Answer

Solution code:
O={'R','U','D'}
E={'L','U','D'}
S=input()
if set(S[::2]) <= O | set(S[1::2]) <= E:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
steps = list(list(input()))
even = True
odd = True
for i in range(0, len(steps), 2):
    if not steps[i] == ('R' or "U" or "D"):
        odd = False

for i in range(1, len(steps), 2):
    if not steps[i] == ("L" or "U" or "D"):
        even = False

if even and odd:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
flag = 1
i = 1
while(i<len(S)):
    if((S[i-1]=="R" or S[i-1]=="U" or S[i-1]=="D") and (S[i]=="L" or S[i]=="U" or S[i]=="D")):
        flag = 1 
    else:
        flag = 0
        break;
    i+=2
if(flag==0):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
n = str(input())
d = []
p = []
i = 1
s = 1
l = 1
for k in n:
 if i % 2 == 0:
  if k == "R" or k == "U" or k == "D":
   pass
  else:
   s = 0
 else:
  if k == "L" or k == "U" or k == "D":
   pass
  else:
    l = 0
 i = i + 1
if s and l == "1":
 print("Yes")
else:
 print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())

k = sorted(set(s[0::2]))
g = sorted(set(s[1::2]))

k2 = []
g2 = []

for i in k:
    if i == 'R' or i == 'U' or i =='D':
        g2.append(True)

for j in g:
    if j == 'L' or j == 'U' or j =='D':
        k2.append(True)

if all(g2) == True and all(k2) == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a=0
s=list(input())
for i in range(int(len(s)/2)):
  if (s[2*i]=='L'):
    a+=1
  elif 2*i+1<len(s):
    if s[2*i+1]=='R':
      a+=1
if a==0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S=input()
a = 0
for i in range(len(S)):
  if i%2==0 :
    S[i] != "L"
    a += 1
  else:
    S[i] != "R"
    a += 1
if a == len(S):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S= list(input())

a=[]
for i in range(0,int((len(S)+1)/2)):
  if S[2*i]== "R" or S[2*i]== "U" or  S[2*i]=="D":
    a.append(1)
  if S[2*i-1]=="L" or S[2*i-1]=="U" or S[2*i-1]=="D":
    a.append(1)

if len(S)==sum(a):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
S=str(input())
n=len(S)
p=0
for i in range(1,n,2):
    if(S[i-1]=="L"):
        print("No")
        break
    if(S[i]=="R"):
        print("No")
        break
    else: p+=1
if(p == n//2):
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
if len(s) == 1:
    if s != "L":
        print("No")
    else:
        print("No")
else:
    for i in range(len(s)//2):
        if s[i*2] == "L" or s[1+i*2] == "R":
            print("No")
            break
    else:
        print("Yes")

Submission status: Wrong Answer

Solution code:
n = str(input())
d = []
p = []
i = 1
s = 1
l = 1
for k in n:
 if i % 2 == 0:
  if k == "R" or k == "U" or k == "D":
   pass
  else:
   s = 0
 else:
  if k == "L" or k == "U" or k == "D":
   pass
  else:
    l = 0
 i = i + 1
if s or l == "1":
 print("Yes")
else:
 print("No")

Submission status: Wrong Answer

Solution code:
S = input()

s = True
for i in range(len(S)-1):
    if i%2 ==0:
        if S[i]!='L' and S[i]!='U' and S[i]!='D':
            s = False
            print('No')
            break
    else:
        if S[i]!='R' and S[i]!='U' and S[i]!='D':
            s = False
            print('No')
            break
if(s):
    print('Yes')

Submission status: Wrong Answer

Solution code:
l=list(input())
l1=['U','D']
c=0
for i in range(len(l)):
    if l[i] not in l1:
        if (i+1)%2==0 and l[i]!='L':
            c=1
            break
        if (i+1)%2!=0 and l[i]!='R':
            c=1
            break
if(c==0):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
s_list = list()

jun = 0
ans = 1

while(len(s_list)):
    if jun % 2 == 0:
        if s_list[jun] == "R" or s_list[jun] == "U" or s_list[jun] == "D":
            pass
        else:
            ans = 0
    if jun % 2 == 1:
        if s_list[jun] == "L" or s_list[jun] == "U" or s_list[jun] == "D":
            pass
        else:
            ans = 0
    jun += 1
if ans == 1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())

result = "Yes"

if S[0::2] !="R"or"U"or"D":
    result = "No"
elif S[1::2] !="L"or"U"or"D":
    result = "no"

print(result)

Submission status: Wrong Answer

Solution code:
S = input()
flag = True
for i in range(0,len(S)-1,2):
    if flag and (S[i]=='R' or S[i]=='U' or S[i]=='D') :
        flag=True
    else:
        flag=False
for i in range(1,len(S)-1,2):
    if flag and (S[i]=='L' or S[i]=='U' or S[i]=='D') :
        flag=True
    else:
        flag=False
if flag:
    print('Yes') 
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = str(input())
d = []
p = []
i = 1
s = 1
l = 1
for k in n:
 if i % 2 == 0:
  if k == "R" or k == "U" or k == "D":
   pass
  else:
   pass
   s = 0
 else:
  if k == "L" or k == "U" or k == "D":
   pass
  else:
    pass
    l = 0
 i = i + 1
if s or l == "1":
 print("Yes")
else:
 print("No")

Submission status: Wrong Answer

Solution code:
S=input()

g=[]
k=[]

for g,k in zip(S[1::2],S[0::2]):
  exit
  
if "R" == g and "L" == k:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
S = str(input())

A = ['Yes','No']
k = 0
glist = ['R','U','D']
klist = ['L','U','D']

for i in range(len(S)-1):
    if i%2 == 0:
        if S[i] not in glist:
            k = 1
            break
    else:
        if S[i] not in klist:
            k = 1
            break

print(A[k])

Submission status: Wrong Answer

Solution code:
rr = raw_input
rri = lambda: int(raw_input())
rrm = lambda: map(int, raw_input().split())

def solve(S):
    return all(c in 'RUD' for c in S[1::2]) and all(c in 'LUD' for c in S[::2])
    

print 'Yes' if solve(rr()) else 'No'

Submission status: Wrong Answer

Solution code:
S = input()
b = list(S)
a = b[0::2]
c = b[1::2]
d = len(b)
e = len(c)
cnt = 0
count = 0
for i in range(d):
    if b == 'R' or 'U' or 'D':
        cnt += 1
for i in range(e):
    if c == 'L' or 'U' or 'D':
        count += 1
if cnt == d and count ==e:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
if len(s) == 1:
    if s != "L":
        print("No")
else:
    for i in range(len(s)//2):
        if s[i*2] == "L" or s[1+i*2] == "R":
            print("No")
            break
    else:
        print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()

kisu = ['R', 'U', 'D']
gusu = ['L', 'U', 'D']

hard = 0

for i in range(len(S)):
    moji = S[i]
    if i % 2 == 0:
        if moji not in gusu:
            hard = 1
            break
        else:
            hard = 0
    elif i % 2 == 1:
        if moji not in kisu:
            hard = 1
            break
        else:
            hard = 0
if hard == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
flg=0
for i in range(0,len(s)-1,2):
    if s[i] not in ["R","U","D"]:
        flg=1
    if s[i+1] not in ["L","U","D"]:
        flg=1
if(flg==1):
    print("No")
else: print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
s_list = []
#sを分割してリスト化
for i in range(len(s)):
    s_list.append(s[i])
for j in range(len(s)):
    if j % 2 == 0:
        if s[j] == "L":
            print("No")
            break
    if j%2  ==  1:
        if s[j] == "R":
            print("No")
            break

print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()
Ls = ['L', 'U', 'D'] #偶数
Rs = ['R', 'U', 'D'] #奇数
l = len(S)
n = l//2
f = True
S = 'R' + S
for i in range(1, n + 1):
    if (S[2*i - 1] in Rs) and (S[2*i] in Ls):
        pass
    else:
        f = False
        break
if f:
    if S[-1] in Rs:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()
for i in range(len(s)):
  if i%2==0:
    if i!='R' or i!='U' or i!='D':
      print('No')
      exit()
  else:
    if i!='L' or i!='U' or i!='D':
      print('No')
      exit()
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
count = 0
add,even = ["R","U","D"],["L","U","D"]
for i in range(len(s)):
    if (i % 2 == 0) and (s[i] in add):
        count += 1
    elif s[i] in even:
        count += 1
print("Yes" if count == len(s) else "No")

Submission status: Wrong Answer

Solution code:
l = ['L', 'R', 'U', 'D']
s = list(input())
ans = 'YES'
for i in range(len(s)):
  if i % 2 == 0:
    if s[i] == 'L':
      ans = 'NO'
      break
  else:
    if s[i] == 'R':
      ans = 'NO'
      break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
b = 'No'
for i in range(len(s)-1):
    if ((i%2)==0)and((s[i]=='R')or(s[i]=='U')or(s[i]=='D')):
        b = 'Yes'
    elif ((i%2)==1)and((s[i]=='L')or(s[i]=='U')or(s[i]=='D')):
        b = 'Yes'
    else:
        b = 'No'
        break

print(b)

Submission status: Wrong Answer

Solution code:
import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    S = input()
    for i in range(len(S)):
        if (i+1) % 2 == 1:
            if S[i] is not "R" and S[i] is not "U" and S[i] is not "D":
                print("No")
                exit()
        else:
            if S[i] is not "L" and S[i] is not "U" and S[i] is not "D":
                print("No")
                exit()
    print("Yes")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S = list(input())

result = "No"
if S[0::2] =="L"or"U"or"D":
    result = "Yes"
elif S[1::2] =="R"or"U"or"D":
    result = "Yes"

print(result)

Submission status: Wrong Answer

Solution code:
s = str(raw_input())
no_flag = False
for i in range(len(s)):
  if i%2 == 0:
    if s[i] == 'L':
      print('NO')
      no_flag = True
      break
  else:
    if s[i] == 'R':
      print('NO')
      no_flag = True
      break
if no_flag == False:
  print('YES')

Submission status: Wrong Answer

Solution code:
S=input()
a = 0
for i in range(len(S)):
  if i%2==1 :
    S[i] != "L"
    a += 1
  else:
    S[i] != "R"
    a += 1
if a == len(S):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=str(input())
b=0
for i in range(len(S)):
    if i%2==0:
        if S[i]=="R" or "U" or "D":
            b+=1
    elif i%2==1:
        if S[i]=="L" or "U" or "D":
            b+=1
if b!=len(S):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input())
a = 0

for i in range(len(S)):
    if S[i%2] == "R" or S[i%2] == "U" or S[i%2] == "D":
        pass
    elif S == "L" or S == "U" or S == "D":
        pass
    else:
        a=1

if a == 1:
    print("No")

else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s=input().split()
for i in range(len(s)):
  if i%2 == 0:
    if s[i] == "L":
      print("No")
      exit()
  else:
    if s[i] == "R":
      print("No")
      exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s = list(input())

g = sorted(set(s[0::2]))
k = sorted(set(s[1::2]))

g2 = []
k2 = []

for i in g:
    if i == 'L' or i == 'U' or i =='D':
        g2.append(True)

for j in k:
    if j == 'R' or j == 'U' or j =='D':
        k2.append(True)

if all(g2) == True and all(k2) == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

import re
if re.fullmatch(r'[RUD]+', S[::2]) is not None and re.fullmatch(r'[LUD]+', S[1::2]) is not None:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

ret = ""

for i in range(len(N)):
  if i%2 == 0:
    if N[i] == "R":
      ret = "Yes"
    elif N[i] == "U":
      ret = "Yes"
    elif N[i] == "D":
      ret = "Yes"
    else:
      ret = "No"
  else:
    if N[i] == "L":
      ret = "Yes"
    elif N[i] == "U":
      ret = "Yes"
    elif N[i] == "D":
      ret = "Yes"
    else:
      ret = "No"
      
print(ret)

Submission status: Wrong Answer

Solution code:
s = list(input())
flg=0
for i in range(0,len(s)-2,2):
    if s[i]  not in ["R","U","D"]:
        flg=1
    if s[i+1] not in ["L","U","D"]:
        flg=1

if(flg==1):
    print("No")
else: print("Yes")

Submission status: Wrong Answer

Solution code:
s=list(input())
s_o = s[::2]
s_e = s[1::2]

od = ["R","U","D"]
ev = ["L","U","D"]
flag1 = False
for i in range(len(s_o)):
    if (s_o[i] in od):
        flag1 = True
    else:
        flag1 = False
        break
flag2 = False
for i in range(len(s_e)):
    if (s_e[i] in ev):
        flag2 = True
    else:
        flag1 = False
        break
if (flag1 and flag2):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
flag=1
for i in range(len(s)):
    if((i+1)%2!=0):
        if(s[i]=='L'):
            print("NO")
            flag=0
            break
    if((i+1)%2==0):
        if(s[i]=='R'):
            print("NO")
            flag=0
            break
if(flag==1):
    print("YES")

Submission status: Wrong Answer

Solution code:
S=input()
x=0
for i in range(len(S)//2):
  if S[2*i]=='L':
   x= x+1
  else:
   x= x
  
  if S[2*i+1]=='R':
   x= x+1
  else:
   x= x
    
if x==0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
p = n//2
d = 0
for i in range(p):
  if s[2*i] == "L" or s[2*i+1] == "R":
    print("No")
    d = 1
    break

if d == 0:
  print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input())
k = 0 
for i in range(0, len(S)):
    if i+1 % 2 == 0:
        if S[i] in "LUD":
            k += 1
        else:
            print("No")
            exit()
    else:
        if S[i] in "RUD":
            k += 1
        else:
            print("No")
            exit()
if k >= 1:
    print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()
S1 = S[::2]
S2 = S[1::2]
f1=S1.find('L')
f2=S2.find('R')
print(f1,f2)
if (f1==-1) and (f2==-1): print("Yes")
else:print("No")

Submission status: Wrong Answer

Solution code:
s = input()
for i in range(0,len(s),2):
  for j in range(1,len(s),2):
    if s[i] not in 'RUD' or s[j] not in 'LUD':
      print('No')
      exit()
print('Yes')