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:
order = input()
if "L" in order[1::2] or "R" in order[::2]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()


#print(len(S))

#print(S[len(S)-1])
def check_step(S):
   for i in range(len(S)-1):
      #print(str((i+1)%2))
      if (i+1)%2==1:
         #print("ki"+S[i])
         if S[i]=="L" :
            print("No")
            return 
      else:
         #print("gu"+S[i])
         if S[i]=="R" :
            print("No")
            return 
   print("Yes")
check_step(S)

Submission status: Wrong Answer

Solution code:
S = input()


def check_step(S):
   for i in range(len(S)-1):
      if (i+1)%2==1:
         if S[i]=="L" :
            print("No")
            return 
      else:
         if S[i]=="R" :
            print("No")
            return 
   print("Yes")
check_step(S)

Submission status: Wrong Answer

Solution code:
#141b
S = str(input()) #S は長さ 1 以上 100 以下の文字列

#S が以下の 2 条件を満たすとき、またその時に限り、Sを「踏みやすい」文字列といいます。
#    奇数文字目がすべて R, U, D のいずれか。
#    偶数文字目がすべて L, U, D のいずれか。
#Sが「踏みやすい」文字列なら Yes を、そうでなければ No を出力してください。

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

Submission status: Wrong Answer

Solution code:
S = input()
print("L" not in S[::2] and "R" not in S[1::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())

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

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
flag = True
for i in range(len(S)):
  if S[i] == 'D' or S[i] == 'U':
    continue
  elif i%2 == 0 and S[i] == 'L' or i%2 != 0 and S[i] == 'R':
    continue
  else:
    flag = False

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
 
t = input()
 
t2 = t[0::2]
t1 = t[1::2]
 
if "L" in t1:
  print("No")
else:
  if "R" in t2:
    print("No")
  else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
import sys

t = input()

t2 = t[0::2]
t1 = t[1::2]

if "L" in t1:
  if "R" in t2:
    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 and s[i] == 'R':
    s = False
    break
  elif i % 2 == 1 and s[i] == 'L':
    s = False
    break

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

Submission status: Wrong Answer

Solution code:
def get_answer(input_list):
    d = input_list[0]
    f1 = True
    f2 = True
    for i in range(len(d)):
        s = d[i]
        if (i + 1) % 2 == 1:
            if s not in ["R","U","D"]:
                f1 = False
        else:
            if s not in ["L","U","D"]:
                f2 = False

    if f1 or f2:
        return "Yes"
    return "No"



if __name__ == "__main__":
    input_list = []
    while True:
        try:
            input1 = input()
            if not input1:
                break
            if len(input1) == 0:
                break
            input_list.append(input1)
        except EOFError:
            break
    print(get_answer(input_list))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())
for i in S[::2]:
    if i == 'R':
        print('No')
        exit()
for i in S[1::2]:
    if i == 'L':
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
table=[{'L':False, 'R':True, 'U':True, 'D':True,},
       {'L':True, 'R':False, 'U':True, 'D':True,}]
S=input()
print(all([table[i%2][c] for i, c in enumerate(S)]))

Submission status: Wrong Answer

Solution code:
a=input().strip()
t=1
for i in range(len(a)):
  if i%2==0 and i not in ['R','U','D']:
    t=0
    break
  elif i%2!=0 and i not in ['L','U','D']:
    t=0
    break
if t==1:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S=str(input())
i=int()
counter=int(0)
for i in range(0,len(S)//2-1) :
    if S[i*2]=="L" or S[i*2+1]=="R":
        counter+=1
if counter==0:
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

Solution code:
str = input()
num = len(str)
ans = True
for i in range(num):
    if (i+1) % 2:
        if str[i] == "R":
            ans = False
    else:
        if str[i] == "L":
            ans = False

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

Submission status: Wrong Answer

Solution code:
str = input()
num = len(str)
ans = True
for i in range(num):
    print(str[i])
    if (i+1) % 2:
        if str[i] == "R":
            ans = False
    else:
        if str[i] == "L":
            ans = False

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S=str(input())
i=int()
1 <= i <= len(S)//2-1
if S[i*2-1]=="R":
    print("No")
elif S[i*2]=="L":
    print("No")
else :
    print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input())
if False not in [i in "R" or "U" or "D" for i in S[::2]] and False not in [i in "L" or "U" or "D" for i in S[1::2]]:
	print("No")
else:
	print("Yes")

Submission status: Wrong Answer

Solution code:
s=list(input())

f=0

for i in range(len(s)):
    if i%2==0:
        if s[i]=='L':
            f+=1
    else:
        if s[i]=='R':
            f+=1
if f>0:
    print('No')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
S = list(input())
if (False not in [i in "R" for i in S[::2]] or False not in [i in "U" for i in S[::2]] or False not in [i in "D" for i in S[::2]]) and (False not in [i in "L" for i in S[1::2]] or False not in [i in "U" for i in S[1::2]] or False not in [i in "D" for i in S[1::2]]):
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = list(map(str, input().split()))
flag =0
for i in range(len(n)):
  if i%2==0:#奇数
    if n[i]=="L":
      flag=1
  elif i%2==1:
    if n[i]=="R":
      flag=1
if flag==0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = list(input())
if False not in [i in "L" for i in S[::2]] or False not in [i in "R" for i in S[1::2]]:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:


def main():
    s = input()
    print('Yes' if is_easy_to_step(s) else 'No')


def is_easy_to_step(strs):
    for i, s in enumerate(strs):
        if i % 2 == 0 and (s == 'L' or s == 'U' or s == 'D'):
            continue
        elif i % 2 != 0 and (s == 'R' or s == 'U' or s == 'D'):
            continue
        else:
            return False

    return True


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s=list(input())

for i in range(len(s)):
  if i // 2 == 1:
    if s[i] == "R":
      print("No")
      break
  elif i // 2 == 0:
    if s[i] == "L":
      print("No")
      break
  if i == len(s)-1:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()

length = len(s)
flag1, flag2= False, False
odds = "RUD"
evens ="LUD"

for x in range (0,len(s),2):
    if s[x] in odds:
        flag1 = True        
    else:
        flag1= False
        break
        

for x in range (1,len(s),2):
    if s[x] in evens:
        flag2 = True
    else:
        flag2 = False
        break

if flag1 ==True and flag2 == True:
    print ("Yes")
else:
    print ("No")

Submission status: Wrong Answer

Solution code:
S = input()
for i,s in enumerate(S):
  if (i%2 == 0)&(s=='L'):
    print('No')
    break
  elif (i%2 == 1)&(s=='R'):
    print('No')
    break
  else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
justified=True
S=list(input())
check1=["R","U","D"]
check2=["L","U","D"]
for j in range(len(S)):
    if( j)%2==0:
        if  S[j] in check1:
            continue
        else:
            justified=False
            break
        
    if (j)%2==1:
        if S[j] in check2:
            continue
        else:
            justified=False
            break
if justified:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
s = input()
count = 0

for i in range(0, len(s)):
    if i % 1 == 0:
        if s[i] == 'L':
            count += 1
    if i % 1 == 1:
        if s[i] == 'R':
            count += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i, j in enumerate(s):
    if i % 2 == 0:
        if j not in odd:
            print('No')
            break
    else:
        if j not in even:
            print('No')
            break
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
S=input()
print('YES' if all([s=='R'or s=='U' or s=='D' for s in S[::2]]) and all([t=='L'or t=='U' or t=='D' for t in S[1::2]]) else 'No')

Submission status: Wrong Answer

Solution code:
s=list(input())

od = ["R","U","D"]
ev = ["L","U","D"]
flag = False
for i in range(len(s)):
    if i%2 ==0:
        if s[i] not in od:
            #print("No")
            break
        else:
            flag = True
    elif i%2 == 1:
        if s[i] not in ev:
            #print("No")
            break
        else:
            flag = True
if flag:      
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=list(input())

od = ["R","U","D"]
ev = ["L","U","D"]
flag = False
for i in range(len(s)):
    if i%2 ==0:
        if s[i] not in od:
            #print("No")
            break
        else:
            flag = True
    elif i%2 == 1:
        if s[i] not in ev:
            #print("No")
            break
        else:
            flag = True
if flag:      
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
flag = 0

for i, c in enumerate(s):
  if (i % 2 == 0) & (c == "R"):
    flag = 1
  elif (i % 2 == 1) & (c == "L"):
    flag = 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())

ki = S[1::2]
gu = S[0::2]
ans = ''
count = 0

for g in gu:
    if g == 'L':
        print("No")
    else:
        for k in ki:
            if k == 'R':
                print("No")
                break
            else:
                count += 1
                if count == len(ki):
                    print("Yes")

Submission status: Wrong Answer

Solution code:
import sys
s=input()
for i in range(len(s)):
  if i%2==0 and s[i]=='L':
    print('No')
    sys.exit
  if i%2==1 and s[i]=='R':
    print('No')
    sys.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')
    exit
  if i%2==1 and s[i]=='R':
    print('No')
    exit
print('Yes')

Submission status: Wrong Answer

Solution code:
import re
hoge = list(input())
i = 0
while i < len(hoge):
    if i%2==0 and re.findall(r'[LDU]',hoge[i]):
        pass
    elif i%2==1 and re.findall(r'[RDU]',hoge[i]):
        pass
    else:
        break
    i+=1
if i == len(hoge):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import re
hoge = list(input())
print(hoge,len(hoge))
i = 0
while i < len(hoge):
    if i%2==0 and re.findall(r'[LDU]',hoge[i]):
        pass
    elif i%2==1 and re.findall(r'[RDU]',hoge[i]):
        pass
    else:
        break
    i+=1
print(i)
if i == len(hoge):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
hoge = list(input())
i = 0
while i < len(hoge):
  if i%2==0 and hoge[i] == ('R' or 'D' or 'U'):
    pass
  elif i%2==1 and hoge[i] == ('L' or 'D' or 'U'):
    pass
  else:
    break
  i+=1
if i+1 == len(hoge):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
hoge = input().split()
i = 0
while i < len(hoge):
  if i%2==0 and hoge[i] == ('R' or 'D' or 'U'):
    pass
  elif i%2==1 and hoge[i] == ('L' or 'D' or 'U'):
    pass
  else:
    break
  i+=1
if i == len(hoge)-1:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
hoge = input().split()
i = 0
while i < len(hoge):
  if i%2==0 and hoge[i] == ('L' or 'D' or 'U'):
    pass
  elif i%2==1 and hoge[i] == ('R' or 'D' or 'U'):
    pass
  else:
    break
  i+=1
if i == len(hoge)-1:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
hoge = input().split()
i = 0
while i < len(hoge):
  if i%2==0 and hoge[i] == ('L' or 'D' or 'U'):
    pass
  elif i%2==1 and hoge[i] == ('R' or 'D' or 'U'):
    pass
  else:
    break
  i+=1
if i == len(hoge):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
hoge = input().split()
i = 0
while i < len(hoge):
  if i%2==0 and hoge[i] == ('R' or 'D' or 'U'):
    pass
  elif i%2==1 and hoge[i] == ('L' or 'D' or 'U'):
    pass
  else:
    break
  i+=1
if i == len(hoge):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys
s = input()
for idx, i in enumerate(s):
    if i == 'R' and (idx+1) % 2 == 0:
        print('NO')
        sys.exit()
    elif i == 'L' and (idx+1) % 2 == 1:
        print('NO')
        sys.exit()
print("YES")

Submission status: Wrong Answer

Solution code:
s = input()
i = 0
flag = True
for c in s:
  i += 1
  if (i % 2 == 0 and c == "R") or (i % 2 == 1 and c == "L"):
    print("No", i, c)
    exit(0)
print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
i = 0
flag = True
for c in s:
  i += 1
  if (i % 2 == 0 and c == "L") or (i % 2 == 1 and c == "R"):
    print("No")
    exit(0)
print("Yes")

Submission status: Wrong Answer

Solution code:
s=input()
l1=['R','U','D']
l2=['L','U','D']
i=0
flg=0
while(i<len(s)-1):
    if((s[i] in l1) and (s[i+1] in l2)):
        flg=0
        i+=2
    else:
        flg=1
        break
if(len(s)%2==1):
    if(s[len(s)-1] not in l2):
        flg=1



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

Submission status: Wrong Answer

Solution code:
s=input()
l1=['R','U','D']
l2=['L','U','D']
i=0
flg=0
while(i<len(s)-1):
    if((s[i] in l1) and (s[i+1] in l2)):
        flg=0
        i+=2
    else:
        flg=1
        break


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
S = (stdin.readline().rstrip())
if (set(S[1::2]) <= {"R","U","D"}) and  (set(S[0::2]) <= {"L","U","D"}):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin
S = (stdin.readline().rstrip())
if (set(S[1::2]) <= {"L","U","D"}) and  (set(S[0::2]) <= {"L","U","D"}):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from sys import stdin
S = (stdin.readline().rstrip())
if (set(S[0::2]) <= {"L","U","D"}) and  (set(S[1::2]) <= {"L","U","D"}):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
t=len(s)
f=0
c=0
for i in range(0,t,2):
    if s[i]=="R" or s[i]=="U" or s[i]=="D":
        f=f+1
    else:
        f=0

for i in range(1,t,2):
    if s[i]=="L" or s[i]=="U" or s[i]=="D":
        c=c+1
    else:
        c=0

if f>0 and c>0 :
     print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
from sys import exit


S = input()

for i in range(len(S)):
    if i // 2 == 1 and S[i] == 'L':
        print('No')
        exit()
    if i // 2 == 0 and S[i] == 'R':
        print('No')
        exit()

print('Yes')

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 "L":
                ans = "No"
        else:
            if S[i] is "R":
                ans = "No"
        if ans == "No":
            print(ans)
            exit()
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve(S):
    return (all(c not in 'RUD' for c in S[::2]) and
            all(c not in 'LUD' for c in S[1::2]))
        
print 'Yes' if solve(raw_input()) else 'No'

Submission status: Wrong Answer

Solution code:
s=list(input())
od = {"R","U","D"}
ev = {"L","U","D"}
flag = False
for i in range(len(s)):
    if i%2 == 0:
        if (s[i] in od):
            flag = True
        else:
            flag = False
            exit()
    if  i%2 !=0:
        if (s[i] in ev):
            flag = True
        else:
            flag = False
            exit()
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
count = 0
count2 = 0
for i in range(len(s)):
    if i%2!=0:
        if s[i]=='L' or s[i]=='U' or s[i]=='D':
            count += 1
    elif i%2==0:
        if s[i]=='R' or s[i]=='U' or s[i]=='D':
            count2 += 1

if count >=len(s)//2 and count2>=len(s)//2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
even = s[0::2]
odd = s[1::2]

if 'L' in odd and 'R' in even or ['U', 'D']:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
n = len(S)//2
i = 0

if len(S)%2 == 0:
    while i <= n-1:
        if S[2*i] != "L" and S[2*i+1] != "R":
            i = i + 1
        else:
            print("No")
            break
    if i == n:
        print("Yes")
else:
    while i <= n-1:
        if S[2*i] != "L" and S[2*i+1] != "R":
            i = i + 1
        else:
            print("No")
            break
    if i == n and S[2*i] != "L":
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
S=input()
s=list(S)
sE=s[1::2]
sO=s[::2]

n=0;m=0;
for i in sO:
    if(i=="L" ):
                n=1;
for i in sE:
    if(i=="R" ):
                m=1;



if(n==1 | m==1):
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = list(input()) ; m = int(len(n))
c = 0 ; d = 0
if m % 2 == 0:
    for i in range(0 , m , 2):#奇数文字目の判定
        if n[i] == "R" or i == "U" or i == "D":
            c += 1
    for j in range(1 , m , 2):#偶数文字目の判定
        if n[j] == "L" or n[j] == "U" or n[j] == "D":
            d += 1
    if c == d:
        print("Yes")
    else:
        print("No")
else:
    for i in range(0 , m , 2): #奇数文字目の判定
        if n[i] == "R" or n[i] == "U" or n[i] == "D":
            c += 1
    for j in range(1 , m , 2): #偶数文字目の判定
        if n[j] == "L" or n[j] == "U" or n[j] == "D":
            d += 1
    if c == d+1:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
S = input()
n = len(S)//2
i = 0

if len(S)%2 == 0:
    while i <= n-1:
        if S[2*i] != "L" and S[2*i+1] != "R":
            i = i + 1
        else:
            print("No")
            break
    if i == n:
        print("Yes")
else:
    while i <= n-1:
        if S[2*i] != "L" and S[2*i+1] != "R":
            i = i + 1
        else:
            print("No")
            break
    if i == n and S[2*i] != "L":
        print("Yes")
    if i == n and S[2*i] != "R":
        print("No")

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:
a=input()
n=len(a)
c=0
d=0
for i in range(1,n+1):
    if i%2==0:
        if a[i-1] in ["L","U","D"]:
            c+=1
    if i%2!=0:
        if a[i-1] in ["R","U","D"]:
            d+=1
if n%2!=0:
    if c==n//2-1 or d==n//2:
        print("NO")
    else:
        print("YES")
else:
    if c==n//2 or d==n//2-1:
        print("NO")
    else:
        print("YES")

Submission status: Wrong Answer

Solution code:
S = input()
odd_S = []
even_S = []

for i in range(0, len(S), 2):
    odd_S.append(S[i])

for j in range(1, len(S), 2):
    even_S.append(S[j])

print(odd_S not in ['L'])

if ['L'] not in odd_S and ['R'] not in even_S:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
odd_S = []
even_S = []

for i in range(0, len(S), 2):
    odd_S.append(S[i])

for j in range(1, len(S), 2):
    even_S.append(S[j])
print(odd_S)
print(even_S)

print(odd_S not in ['L'])

if ['L'] not in odd_S and ['R'] not in even_S:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

a = len(S)
cnt = 0
for i in range(a):
#奇数の場合
  if i % 2==0:
#L以外が含まれる（Lではない）
    if S[i] != "L":
      cnt +=1
    elif S[i] == "L":
      cnt -= 10
#偶数の場合
  elif i %2 ==1:
#R以外が含まれる（Rではない）
    if S[i] != "R":
      cnt +=1
    elif S[i]=="R":
     cnt -= 10

if cnt>0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
'''__author__ = 'Esfandiar'
from collections import defaultdict
n,k,q=map(int,input().split())
d = defaultdict(int)
for i in range(q):
        a = int(input())
        d[a]+=1
for i in range(1,n+1):
        if k-(q-d[i]) <=0:
                print("NO")
        else:
                print("YES")'''



s = input()
a=s[::2]
b=s[1::2]
for i in a:
        if i == 'L':
                print("NO")
                exit()
for i in b:
        if i == 'R':
                print("NO")
                exit()
print("YES")

Submission status: Wrong Answer

Solution code:
S = input()
n = len(S)//2
i = 0

if len(S)%2 == 0:
    while i <= n-1:
        if S[2*i] != "L" and S[2*i+1] != "R":
            i = i + 1
        else:
            print("No")
            break
    if i == n:
        print("Yes")
else:
    while i <= n-1:
        if S[2*i] != "L" and S[2*i+1] != "R":
            i = i + 1
        else:
            print("No")
            break
    if i == n and S[2*i] != "L":
        print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input())

c = 1
while len(S) > 0:
    s = S.pop()
    if c%2==1: 
        if s == 'L':
            print('No')
            break
    else:
        if s == 'R':
            print('No')
            break

    c+=1

else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
S = list(input())

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

for i in range(len(Odd)):
    if 'L' == Odd[i]:
        l = 0
        break
    else:
        l = 1

r = 1
for j in range(len(Even)):
    if 'R' == Even[j]:
        r = 0
        break
    else:
        r = 1

Submission status: Wrong Answer

Solution code:
s = input()
a=s[::2]
b=s[1::2]
for i in a:
        if i == 'L':
                print("NO")
                exit()
for i in b:
        if i == 'R':
                print("NO")
                exit()
print("YES")

Submission status: Wrong Answer

Solution code:
s = input()
s_even = list(s[1::2])
s_odd = list(s[0::2])
odd = ["R","U","D"]
even = ["L","U","D"]
if s_odd in odd:
  if s_even in even:
    print("Yes")
  else:
  	print("No")
else:
  print("No")

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        
if len(S) % 2 == 0:
	print("Yes")
elif len(S) % 2 == 1:
	if S[len(S) - 1] == "L":
		print("No")
	else:print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input())

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

l = 0
for i in range(len(Odd)):
    if 'L' == Odd[i]:
        l = 0
        break
    else:
        l = 1

r = 0
for j in range(len(Even)):
    if 'R' == Even[j]:
        r = 0
        break
    else:
        r = 1

if l+r == 2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
c = len(s)
flg = 1
for i in range(0,c-1):
  if i%2 == 0 :
    if s[i]=="R" or s[i]=="U" or s[i]=="D":
      flg = flg*1
    else:
      flg = flg*0
  else:
    if s[i]=="L" or s[i]=="U" or s[i]=="D":
      flg = flg*1 
    else:
      flg = flg*0
if flg == 0:
  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"}
if (od-set(s_o))==set() and  (ev-set(s_e))==set():
    print("Yes")
else:
    print("No")