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()

i=0

for x in range(len(s)):
    if(i%2==1):
        if(s[i] !='R' or 'U' or 'D'):
            flug=1
            break
    else:
        if(s[i] !='L' or 'U' or 'D'):
            flug=1
            break

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

Submission status: Wrong Answer

Solution code:
s=input()

i=0

for x in range(len(s)):
    if(i%2==1):
        if(s[i] =='R' or 'U' or 'D'):
            flug=1
    else:
        if(s[i] =='L' or 'U' or 'D'):
            flug=1

if(flug!=1):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
a = input()

b =  ['R','U','D']
c =  ['L','U','D']
f= 0
for n,x in enumerate(a):
    if n%2==0 and x not in b : f = 1
    else:
        if x not in c : f = 1
def Y(a,t = 0):
    if a==t : print('YES')
    else : print('NO')
def y(a, t =0):
    if a==t : print('Yes')
    else : print('No')
y(f)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = input()

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

Submission status: Wrong Answer

Solution code:

s=input()

for i in range(len(s)):
  if i%2==0 and s[i]=="L":
    print("No")
  elif i%2==1 and s[i]=="R":
    print("No")
  else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
#coding:utf-8

S = input()

if (not 'L' in set(S[1::2])) and (not 'R' in set(S[0::2])):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
s1 = s[0::2] #奇数
s2 = s[1::2] #偶数

if 'L' in s1:
    print('No')
elif 'R' in s2:
    print('Yes')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
t=list(input())
for i in range(len(t)):
  if i%2==1:
    if not (t[i]=="L"):
      if i%2==0:
        if not (t[i]=="R"):
          print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
strings = input()
for i, step in enumerate(strings):
  if i % 2 == 0 and step == 'L':
    print('No')
  elif i % 2 == 1 and step == 'R':
    print('No')
print('Yes')

Submission status: Wrong Answer

Solution code:
s=input()
i,b=0,0
while i<len(s):
	if (((s[i]=='R') & (i%2==1))|((s[i]=='L') & (i%2==0))):
		b=1
		break
	i+=1
if(b):
	print('YES')
else:
	print('NO')

Submission status: Wrong Answer

Solution code:
s=input()
i,b=0,0
while i<len(s):
	if (((s[i]=='R') & (i%2==1))|((s[i]=='L') & (i%2==0))):
		b=1
		break
	i+=1
if(b):
	print('NO')
else:
	print('YES')

Submission status: Wrong Answer

Solution code:
s=input()
i,b=0,0
while i<len(s):
  if (((s[i]=='R') & (i%2==0))|((s[i]=='L') & (i%2==1))):
    b=1
    break
if(b):
  print('NO')
else:
  print('YES')

Submission status: Wrong Answer

Solution code:
dance = input()
judge = True

for i in range(len(dance)):
    if i % 2 == 0 and dance[i] == "R":
        judge = False
        break
    if i % 2 == 1 and dance[i] == "L":
        judge = False
        break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input();print('Yes' if ('L' in S[::2]) == 1 & ('R' in S[1::2] == 1) else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()
num=1
ans="No"
while True:
  word=S[0]
  if num%2==1 :
    if not (word=="R") or (word=="U") or (word=="D") :
      break
  else:
    if not (word=="L") or (word=="U") or (word=="D") :
      break
  if len(S)==1 :
    ans="Yes"
    break
  S=S[1:]
  num+=1
  
print(ans)

Submission status: Wrong Answer

Solution code:
D = list(input())

A, B = [D[i] for i in range(0, len(D), 2)], [D[i] for i in range(1, len(D), 2)]
iA,iB = list("RUD"),list("LUD")

for v in A:
    if v not in iA:
        print("No")
        exit(0)
print("Yes")

Submission status: Wrong Answer

Solution code:
a = list(input())
print(a)
i = 0
while True:
    odd = a[i]
    if odd == 'L':
        print('NO')
        break
    i += 1
    if i == len(a):
        print('YES')
        break
    even = a[i]
    if even == 'R':
        print('NO')
    i += 1
    if i == len(a):
        print('YES')
        break

Submission status: Wrong Answer

Solution code:
s = input()

isOdd = True
for i in range(len(s)):
    if i % 2 == 1:
        if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
            isOdd = False

isEven = True
for i in range(len(s)):
    if i == 0 or i % 2 == 0:
        if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
            isEven = False

if isOdd == True or isEven == True:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"py.py","provenance":[]},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"code","metadata":{"id":"H3laJejZ8tH7","colab_type":"code","colab":{"base_uri":"https://localhost:8080/","height":35},"outputId":"13f7e97e-3eae-44b3-ce92-df84580aa0d6","executionInfo":{"status":"ok","timestamp":1569272992629,"user_tz":-540,"elapsed":1544,"user":{"displayName":"ryo t","photoUrl":"","userId":"15768515004963573815"}}},"source":["print(\"a\")"],"execution_count":1,"outputs":[{"output_type":"stream","text":["a\n"],"name":"stdout"}]}]}

Submission status: Wrong Answer

Solution code:
s = input()

for i in range(len(s)):
    if i % 2 ==0:
        if s[i] == "L" or s[i] == "U" or s[i] == "D":
            ans = "Yes"
        else:
            ans = "No"
            break
    elif i % 2 ==1:
        if s[i] =="R" or s[i] == "U" or s[i] == "D":
            ans = "Yes"
        else:
            ans = "No"
            break
print(ans)

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":
            ans = "YES"
        else:
            ans = "NO"
            break
    elif i%2 ==1:
        if s[i] =="L" or s[i] == "U" or s[i] == "D":
            ans = "YES"
        else:
            ans = "NO"
            break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

for i in range(len(s)):
    if i % 2 ==0:
        if s[i] == "L" or s[i] == "U" or s[i] == "D":
            ans = "YES"
        else:
            ans = "NO"
            break
    elif i % 2 ==1:
        if s[i] =="R" or s[i] == "U" or s[i] == "D":
            ans = "YES"
        else:
            ans = "NO"
            break
print(ans)

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":
            ans = "YES"
        else:
            ans = "NO"
            break
    elif i % 2 ==1:
        if s[i] =="L" or s[i] == "U" or s[i] == "D":
            ans = "YES"
        else:
            ans = "NO"
            break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

for i in range(len(s)):
    if i % 2 ==0:
        if s[i] == "R" or "U" or"D":
            ans = "Yes"
        else:
            ans = "No"
            break
    elif i % 2 ==1:
        if s[i] =="L" or "U" or "D":
            ans = "Yes"
        else:
            ans = "No"
            break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

for i in range(len(s)):
    if i % 2 ==0:
        if s[i] == "R" or "U" or"D":
            ans = "YES"
        else:
            ans = "NO"
            break
    elif i % 2 ==1:
        if s[i] =="L" or "U" or "D":
            ans = "YES"
        else:
            ans = "NO"
            break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

for i in range(len(s)):
    if i % 2 ==0:
        if s[i] == "R" or "U" or"D":
            print("YES")
        else:
            print("NO")
            break
    elif i % 2 ==1:
        if s[i] =="L" or "U" or "D":
            print("YES")
        else:
            print("NO")
            break

Submission status: Wrong Answer

Solution code:
import sys
S = input()
def tapdance() :
    i = 0
    L = len(S)
    for i in range(L):
        if i % 2 == 0:
            if S[i] == 'L' :
                print('No')
                return 
        else :
            if S[i] == 'R' :
                print('No')
                return 
    return('Yes')

tapdance()

Submission status: Wrong Answer

Solution code:
S = str(input())

check = 0
for i in range(len(S)):
    if S[i] == 'L' or  S[i] ==  'R' or S[i] == 'U' or S[i] == 'D':
        check += 0
    else:
        check += 1

if 1 <= len(S) <= 100 and check==0:
    pass
else:
    print('EROOR')
    S = str(input())

RUD = 0
LUD = 0

for i in range(0,len(S),2):
    if S[i] == 'R' or S[i] == 'U' or S[i] == 'D':
        RUD += 0
    else:
        RUD += 1
        
for i in range(1,len(S),2):
    if S[i] == 'L' or S[i] == 'U' or S[i] == 'D':
        LUD += 0
    else:
        LUD += 1

if RUD == 0 or LUD == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

flag = False

for i in range(len(S) - 1):
    if i % 2 == 0: # 奇数番目
        if S[i] == 'L':
            flag = True
            break
    else: # 偶数番目
        if S[i] == 'R':
            flag = True
            break

if flag:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()

for i in range(len(s)):
    if (i % 2 == 0) and s[i] == "R":
        print("No")
        break
    elif (i % 2 != 0) and s[i] == "L":
        print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
ans = ''
for i, num in enumerate(s, 1):
    if i % 2 ==0:
        if num == 'L' or num == 'U' or num == 'D':
            ans = 'Yes'
    else:
        if num == 'R' or num == 'U' or num == 'D':
            ans = 'Yes'
    if not ans == 'Yes':
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
ans = ''
for i, num in enumerate(s, 1):
    if i % 2 ==0:
        if num == 'L' or num == 'U' or 'num' == 'D':
            ans = 'Yes'
    else:
        if num == 'R' or num == 'U' or 'num' == 'D':
            ans = 'Yes'
    if not ans == 'Yes':
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
c=input()
test='Yes'
for i in range (len(c)) :
    if( i % 2) ==0 :
        if not (c[i] in 'ULD') :
            test = 'No'
            break
    else :
        if not (c[i] in 'URD') :
            test = 'No'
            break
print( test)

Submission status: Wrong Answer

Solution code:
def main():
        
    S = input()
    
    if "L" in S[::2] or "R" in S[1::2] == True:
        print("No")
    else:
        print("Yes")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input().strip()

odd_set = set(["R", "U", "D"])
even_set = set(["L", "U", "D"])

flag = True
for i,s in enumerate(S):
  if((i+1)%2 == 0):
    if(s not in odd_set):
      flag = False
      break
  else:
    if(s not in even_set):
      flag = False
      break
if(flag):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
str = input()

str0 = str[1::2]
str1 = str[::2]
retStr = 'Yes'

for item in str0:
	if item == 'R':
  		retStr = 'No'

if retStr == 'No':
	retStr = 'Yes'
	for item in str1:
		if item == 'L':
  			retStr = 'No'

print(retStr)

Submission status: Wrong Answer

Solution code:
import re

s = input()
pattern = re.compile(r'^([^L][^R])*[L]?$')
is_easy_to_dance = pattern.match(s)

print("Yes") if is_easy_to_dance else print("No")

Submission status: Wrong Answer

Solution code:
words = list(input())

is_easy_to_dance = True

for index, word in enumerate(words):
    is_even = index % 2 == 0
    if (is_even and word == "L") or ((not is_even) and word == "R") :
        continue
    else:
        is_easy_to_dance = False
        break

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

Submission status: Wrong Answer

Solution code:
words = list(input())

for index, word in enumerate(words):
    isEven = index % 2 == 0
    if (isEven and word == "L") or ((not isEven) and word == "R") :
        continue
    else:
        print("NO")

print("YES")

Submission status: Wrong Answer

Solution code:
words = list(input())

for index, word in enumerate(words):
    isEven = index % 2 == 0
    if (isEven and word == "L") or (not isEven and word == "R") :
        continue
    else:
        print("NO")

print("YES")

Submission status: Wrong Answer

Solution code:
dance=input()
char=list(dance)
swt=0
#odd
for i in range((len(dance)+1)//2):
    #print(i)
    if (char[2*i] == "L"):
        swt += 1
#even
for i in range(len(dance)//2):
    #print(i)
    if(char[2*i+1] == "R"):
        swt += 1

if (swt==0):
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())

for c in range(1,len(S)+1):
    s = S.pop()
    if c%2==1: 
        if s == 'L':
            print('No')
            break
    else:
        if s == 'R':
            print('No')
            break
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
S=input()
a=S[::2]
b=S[1::2]
if 'L' not in a:
	pass
	if 'R' not in b:
		print('Yes')
else:
	print('No')

Submission status: Wrong Answer

Solution code:
S = list(map(str, input().split()))
for i in range(len(S)):
  if i%2 == 1:
    if S[i] == ('R' or 'U' or 'D'):
      True
  else:
    if S[i] == ('L' or 'U' or 'D'):
      True
if True:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
import sys
odd = 'RUD'
even = 'LUD'
step = input()
odd_step = step[0::2]
even_step = step[1::2]
for o in odd_step:
    if not o in odd:
        print('NO')
        sys.exit(0)
for e in even_step:
    if not e in even:
        print('NO')
        sys.exit(0)
print('YES')

Submission status: Wrong Answer

Solution code:
odd = 'RUD'
even = 'LUD'
step = input()
odd_step = step[0::2]
even_step = step[1::2]
success_odd = len(list(filter(lambda c: c in odd, odd_step))) == len(odd_step)
success_even = len(list(filter(lambda c: c in even, even_step))) == len(even_step)
print('YES' if success_odd and success_even else 'NO')

Submission status: Wrong Answer

Solution code:
odd = 'RUD'
even = 'LUD'
step = input()
odd_step = step[0::2]
print(odd_step)
even_step = step[1::2]
print(even_step)
success_odd = len(list(filter(lambda c: c in odd, odd_step))) == len(odd_step)
success_even = len(list(filter(lambda c: c in even, even_step))) == len(even_step)
print('YES' if success_odd and success_even else 'NO')

Submission status: Wrong Answer

Solution code:
odd = 'RUD'
even = 'LUD'
step = input()
odd_step = step[0:: 2]
print(odd_step)
even_step = step[1:: 2]
print(even_step)
success_odd = len(list(filter(lambda c: c in odd, odd_step))) == len(odd_step)
success_even = len(
    list(filter(lambda c: c in even, even_step))) == len(even_step)
print('YES' if success_odd and success_even else 'NO')

Submission status: Wrong Answer

Solution code:
s=input()
flag=1
for i in s[0:-1:2]:
    if not (i in "RUD"):
        flag=0
for i in s[1:-1:2]:
    if not (i in "LUD"):
        flag=0
if flag:
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

Solution code:
x = list(input())
i = 0
edetector = True
odetector = True
while i < len(x):
    if  i % 2 == 0:
        if x[i] not in ["L", "U", "D"]:
            edetector = False
    else:
        if x[i] not in ["R", "U", "D"]:
            odetector = False
    i += 1

if edetector and odetector:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()

for i in s:
    if s.index(i)%2==0 :
        if s[s.index(i)] == 'L':
            print('No')
            break
        else:
            pass
    else:
        if s[s.index(i)] == 'R':
            print('No')
            break
        else:
            pass

else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input().split()
if s[1::2]=="R"or"U"or"D" and s[0::2]=="L"or"U"or"D":
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
print("Yes")

Submission status: Wrong Answer

Solution code:
def tap_dance(st):
  size = len(st)
  for i in range(size):
    if (i+1) % 2 == 0:
      if st[i] not in "LUD":
        return False
    else:
      if st[i] not in "RUD":
        return False
  return True
st = input()
print(tap_dance(st))

Submission status: Wrong Answer

Solution code:
S = input()
count = 0
for letter in S:
    count += 1
    if count % 2 == 1 and letter == "L":
        print("No")
        break
    elif count % 2 == 0 and letter == "R":
        print("No")
        break
if count == len(S):
    print("Yes")

Submission status: Wrong Answer

Solution code:
import re
step = input()

x = 2
for char in step:
	if x%2 == 0:
		ans = re.match('L|U|D',char)
	else:
		ans = re.match('R|U|D',char)
	if ans == None:
		print('No')
		exit()

	x += 1

print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
flag = 0
for index, word in enumerate(S):
  if (word == 'U' or word == 'D') or (index%2 == 0 and word == 'L') or (index%2 == 1 and word == 'R'):
    pass
  else:
    flag = 1
    break;
print('Yes' if flag ==0 else 'No')

Submission status: Wrong Answer

Solution code:
S = input()
flag = 0
for index, word in enumerate(S):
  if (word == 'U' or word == 'D') or (index%2 == 0 and word == 'L') or (index%2 == 0 and word == 'R'):
    pass
  else:
    flag = 1
    break;
print('Yes' if flag ==0 else 'No')

Submission status: Wrong Answer

Solution code:
s=input()

s_1 = set(list(s[1::2]))
s_2 = set(list(s[0::2]))

if {"R","U","D"} >= s_1:
  if {"L","U","D"} >= s_2:
  	print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=input()

s_1 = set(list(s[1::2]))
s_2 = set(list(s[0::2]))

if {"R","U","D"} >= s_1 and {"L","U","D"} >= s_2:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=input()

k_s = set(list(s[0::2]))#奇数
g_s = set(list(s[1::2]))#偶数



if {"R","U","D"} >= k_s or {"L","U","D"} >= g_s:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import re
step = input()

if len(step) == 0 or len(step) > 100:
	print('ステップ文字列は1以上100以下で入力してください')
	exit()


x = 2
for char in step:
	if x%2 == 0:
		ans = re.match('L|U|D',char)
	else:
		ans = re.match('R|U|D',char)
	if ans == None:
		print('No')
		exit()
	print(str(x-1) + '文字目は' + char)
	x += 1

print('Yes')

Submission status: Wrong Answer

Solution code:
import re
step = input()

if not step:
	print('ステップ文字列を入力してください')
	exit()

x = 2
for char in step:
	if x%2 == 0:
		ans = re.match('L|U|D',char)
	else:
		ans = re.match('R|U|D',char)
	if ans == None:
		print('No')
		exit()
	print(str(x-1) + '文字目は' + char)
	x += 1

print('Yes')

Submission status: Wrong Answer

Solution code:
import re
step = input()
x = 2
for char in step:
	if x%2 == 0:
		ans = re.match('L|U|D',char)
	else:
		ans = re.match('R|U|D',char)
	if ans == None:
		print('No')
		exit()
	x += 1

print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()

#奇数判定関数
def oj():
  o = None
  
  for i in S[0::2]:
    if i == "L":
      o = "n"
    else:
      o = "y"
  return o
  
#偶数判定関数
def ej():
  e = None
  
  for i in S[1::2]:
    if i == "R":
      e = "n"
    else:
      e = "y"
  return e
  

def j(o,e):
  if o == "y" and e == "y":
    print("Yes")
  else:
    print("No")

j(oj(),ej())

Submission status: Wrong Answer

Solution code:
S = input()

def oj():
  for i in S[0::2]:
    if i == "L":
      return "n"
    break
  else:
    return "y"
  
def ej():
  for i in S[1::2]:
    if i == "R":
      return "n"
    break
  else:
    return "y"

def j(o,e):
  if o == "y" and e == "y":
    print("Yes")
  else:
    print("No")

j(oj(),ej())

Submission status: Wrong Answer

Solution code:
def f():
  literal_state = 0
  a = ["Ini","Yes","No"]
  
  S = input()
  
  #奇数文字目の判定
  for i in S[0::2]:
    if i is "L":
      literal_state = 2
      break
    else:
      #偶数番目の判定
      for i in S[1::2]:
        if i is "R":
          literal_state = 2
          break
        else:
          literal_state = 1
          break
  print(a[literal_state])
f()

Submission status: Wrong Answer

Solution code:
S = str(input())
odd = []
even = []
A = False
B = False

for i in range(len(S)):
    if i % 2 == 0:
        odd.append(S[i])
    else:
        even.append(S[i])

for i in range(len(odd)):
    if odd[i] == 'R' or odd[i] == 'U' or odd[i] == 'D':
        A = True
    else:
        A = False
        break

for i in range(len(even)):
    if even[i] == 'L' or even[i] == 'U' or even[i] == 'D':
        B = True
    else:
        B = False
        break

if A == True and B == True:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
 
S_contains = list(v for v in S)
 
even_list = S_contains[1::2]
odd_list = S_contains[0::2]
 
if not 'R' in even_list and 'L' in odd_list:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

S_contains = list(v for v in S)

odd_list = S_contains[0::2]
even_list = S_contains[1::2]

print(odd_list)
print(even_list)

answer = 'No'

if 'L' in odd_list:
    print(answer)
    exit()
else:
    if 'R' in even_list:
        print(answer)
    else:
        answer = 'Yes'

print(answer)

Submission status: Wrong Answer

Solution code:
S = input()

S_contains = list(v for v in S)

even_list = S_contains[0::2]
odd_list = S_contains[1::2]

if not 'R' in even_list and 'L' in odd_list:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

S_contains = list(v for v in S)

even_list = S_contains[0::2]
odd_list = S_contains[1::2]

if 'R' in even_list and 'L' in odd_list:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys

s=input()
a=1
for i in range(int(len(s))):
    if i%2==0 and (s[i]=="L" or s[i]=="U" or s[i]=="D"):
        a=1
    elif i%2!=0 and (s[i]=="R" or s[i]=="U" or s[i]=="D"):
        a=1
    else:
        a=0
if a==1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8

import sys

s=input()
for i in range(int(len(s))):
    if i%2==0 and (s[i]=="L" or s[i]=="U" or s[i]=="D"):
        print("Yes")
    elif i%2!=0 and (s[i]=="R" or s[i]=="U" or s[i]=="D"):
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
S=input()
for n in range(len(S)//2):
    if len(S)%2 > 0:
        if S[2*n] == 'L' or S[2*n+1] == 'R' or S[-1] == 'L':
            print('No')
            exit()
    elif len(S) % 2 == 0:
        if S[2*n] == 'L' or S[2*n+1] == 'R':
            print('No')
            exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
S=input()
for n in range(len(S)//2):
    if S[2*n] == 'L' or S[2*n+1] == 'R':
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
ws = input()
list_e=[]
list_o=[]

for n, v in enumerate(ws):
  if n % 2 == 0:
    list_e.append(v)
  else:
    list_o.append(v)

if "L" not in list_e and "R" not in list_o:
  print("yes")
else:
  print("no")

Submission status: Wrong Answer

Solution code:
s = input()
a = s[::2]
b = s[1::2]

if a in "L" or b in "R":
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
a = s[::2]
b = s[1::2]

if not a in "L" and not b in "R":
  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] == 'L':
            print('No')
            break
    else:
        if S[i] == 'R':
            print('No')
            break

print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
str_list = list(S)
even_str = str_list[0::2]
odd_str = str_list[1::2]
if ('R' in even_str):
  print('No')
elif ('L' in odd_str):
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
S=list(input())

flag=0

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

Submission status: Wrong Answer

Solution code:
S=input("高橋君の動きを入力してください:")
n=len(S)
if "L" not in S[0:n:2]:
    if "R" not in S[1:n:2]:
        print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
flg=0
for i in range(len(S)):
    if i/2==0:
        if S[i]=="L":
            flg=1
            break
    else:
        if S[i]=="R":
            flg=1
            break

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

Submission status: Wrong Answer

Solution code:
s = input()
valid = True
for i in range(len(s)):
    if i % 2 == 0:
        if not (s[i] in ['L', 'U', 'D']):
            valid = False
            break
    else:
        if not (s[i] in ['R', 'U', 'D']):
            valid = False
            break
if valid:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())

odd_list = ['R', 'U', 'D']
even_list = ['L', 'U', 'D']
indic_list = []
for i in S:
    if (S.index(i)+1) % 2 == 0:
        if i in even_list:
            indic_list.append(True)
        else:
            indic_list.append(False)
    else:
        if i in odd_list:
            indic_list.append(True)
        else:
            indic_list.append(False)

if all(indic_list):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
tap = input()

tap_list = list(tap)

for val in range(len(tap)):
	if ('R' in tap_list[val]) and (val%2 == 0) :
		print('No')
	elif ('L' not in tap_list[val])and (val%2 ==1) :
		print('Yes')
	else:
		print('No')

Submission status: Wrong Answer

Solution code:
S = str(input())

odd_list = ['R', 'U', 'D']
even_list = ['L', 'U', 'D']
indic_list = []
for i in S:
    ine_now = S.index(i)+1
    if (S.index(i)+1) % 2 == 0:
        if i in even_list:
            indic_list.append(True)
        else:
            indic_list.append(False)
    elif (S.index(i)+1) % 2 != 0:
        if i in odd_list:
            indic_list.append(True)
        else:
            indic_list.append(False)

if all(indic_list):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())

print(s)
flag = 0

for i in range(len(s)):
    if i%2==0:
        if s[i] == 'R':
            flag = 1
    else:
        if s[i] == 'L':
            flag = 1

if flag == 1:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
S = str(input())

odd_list = ['R', 'U', 'D']
even_list = ['L', 'U', 'D']
indic_list = []
for i in S:
    if S.index(i) % 2 == 0:
        if i in even_list:
            indic_list.append(True)
        else:
            indic_list.append(False)
    elif S.index(i) % 2 != 0:
        if i in odd_list:
            indic_list.append(True)
        else:
            indic_list.append(False)

if all(indic_list):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = "RDULULDURURLRDULRLR"

even_list = ['R', 'U', 'D']
odd_list = ['L', 'U', 'D']
indic_list = []
for i in S:
    if S.index(i) % 2 == 0:
        if i in even_list:
            indic_list.append(True)
        else:
            indic_list.append(False)
    elif S.index(i) % 2 != 0:
        if i in odd_list:
            indic_list.append(True)
        else:
            indic_list.append(False)

if all(indic_list):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = ' '
S = S + input()

even_pat = 'LUD'
odd_pat = 'RUD'

flag = True

for s in range(1,len(S)):
    if s % 2 == 0:
        if S[s] in even_pat:
            pass
        else:
            flag = False
    else:
        if S[s] in odd_pat:
            pass
        else:
            flag == False
if flag:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:

S = input()

even_pat = 'LUD'
odd_pat = 'RUD'

flag = True

for s in range(len(S)):
    if (s+1) % 2 == 0:
        if S[s] in even_pat:
            pass
        else:
            flag = False
    else:
        if S[s] in odd_pat:
            pass
        else:
            flag == False
if flag:
    print('Yes')
else:
    print('No')