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:
def tapdance(s):
    for i in range(len(s)):
        if i % 2 == 0:
            if s[i] != 'L':
                return 'No'
        else:
            if s[i] != 'R':
                return 'No'
    return 'Yes'
s = input()
print(tapdance(s))

Submission status: Wrong Answer

Solution code:
o="RUD"
g="LUD"

s=input()

i=0
while i<len(s):
  if i%2==0:
    if s[i] =="R":
      print("No")
      exit()
    elif s[i]=="L":
      print("No")
      exit()
  i+=1
  
print("Yes")

Submission status: Wrong Answer

Solution code:
li = list(input())
od = li[0::2]
ev = li[1::2]

for i in range(len(od)):
    if od[i] == "L" or od[i] == "U" or od[i] == "D":
        pass
    else:
        print("No")
        exit()
for j in range(len(ev)):
    if ev[j] == "R" or ev[j] == "U" or ev[j] == "D":
        pass
    else:
        print("No")
        exit()
        
print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
x = len(s) - 1
m = 0
n = 1
c = 0
while m <= x:
  if s[m] == 'R':
    c += 1
  m += 2
while n <= x:
  if s[n] == 'L':
    c += 1
  n += 2
if c == 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys
s = sys.stdin.readline()
flag = True
i = 0
while i < len(s):
  if i % 2:
    if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
      flag = False
      break
  else:
    if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
      flag = False
      break
  i += 1
if flag:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
import sys
s = sys.stdin.readline()
flag = True
i = 0
while i < len(s):
  if i % 2:
    if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
      flag = False
      break
  else:
    if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
      flag = False
      break
  i += 1
if flag:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:

s = list(input())

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

Submission status: Wrong Answer

Solution code:
s=input()
flg=False

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

Submission status: Wrong Answer

Solution code:
S = list(input())
Ki = S[::2]
Gu = S[1::2]
count=0
for i,k in zip(S[::2],S[1::2]):
    if k=='R'or i=='L':
        print('No')
        break
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
S = list(input())
for i,k in zip(S[::2],S[1::2]):
    if k=='R'or i=='L':
        print('No')
        break
else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=input()
b=list(a)
c=1
x=0
ans={"L":1,"R":0,"U":0,"D":0}
ans2={"L":0,"R":1,"U":0,"D":0}
for i in b:
    if int(c)%2==1:
        x=x+ans[i]
    elif int(c)%2==0:
        x=x+ans2[i]
    c=c+1
if x>=1:
	print("No")
else:
  	print("yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(len(s)):
    if (i+1) % 2 == 1:
        if s[i] not in odd:
            print('No')
            exit(0)
    else:
        if s[i] not in even:
            print('No')
            exit(0)

print('Yes')

'''

odd = s[::2]
even = s[1::2]
print(odd)
print(even)
if 'L' in odd or 'R' in even:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()

odd = {c for i, c in enumerate(S, 1) if i % 2 != 0}
even = {c for i, c in enumerate(S, 1) if i % 2 == 0}

if odd == { 'R', 'U', 'D' } and even == { 'L', 'U', 'D' }:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
N = len(S)

for i in range(N//2):
  if S[i*2] != "R" and S[i*2] != "U" and S[i*2] != "D":
    print("No")
    exit()
    
for i in range(N//2):
  if S[i*2-1] != "L" and S[i*2-1] != "U" and S[i*2-1] != "D":
    print("No")
    exit()
    
print("Yes")

Submission status: Wrong Answer

Solution code:
s = list(input())

a = 0
b = 0
ans = 0
for i in range(len(s)//2):
    if s[2*i] == "R" or s[2*i] == "U" or s[2*i] == "D":
        a += 1
    if s[2*i+1] == "L" or s[2*i+1] == "U" or s[2*i+1] == "D":
        b += 1
if len(s)%2 == 0:
    if a == (len(s)-1)//2 and b == len(s)//2:
        ans = 1
else:
    if a == (len(s))//2 and b == (len(s)-1)//2:
        ans = 1
if ans ==1:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())

a = 0
b = 0
for i in range(len(s)//2):
    if s[2*i] == "R" or s[2*i] == "U" or s[2*i] == "D":
        a += 1
    if s[2*i+1] == "L" or s[2*i+1] == "U" or s[2*i+1] == "D":
        b += 1
if a >= len(s)//2 and b >= len(s)//2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = list(input())
n = len(S)
cnt=0
for i in range(int(n/2)):
	if S[2*i]=='L' or S[2*i+1]=='R':
		print('No')
		cnt+=1
		break
	else:
		continue

if cnt == 0:
	print('Yes')

Submission status: Wrong Answer

Solution code:
S = list(input())
n = len(S)
cnt=0
for i in range(int(n/2)):
	if S[2*i]=='L':
		print('No')
		cnt+=1
		break
	elif S[2*i+1]=='R':
		print('No')
		cnt+=1
		break
	else:
		continue

if cnt == 0:
	print('Yes')

Submission status: Wrong Answer

Solution code:
string = str(input())
flag = True
for i in range(len(string)):
	if (i+1)%2==0:
		if( string[i]!='L' and string!='U' and string[i]!='D' ):
			flag = False
			break
	else:
		if ( string[i]!='R' and string!='U' and string[i]!='D' ):
			flag = False
			break
if(flag):
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=list(map(str,input()))
N=len(S)

count=0
for i in range(N):
  if i %2==0:
    if S[i]=="R":
      count+=1
    else:
      count+=0
  if i %2==1:
    if S[i]=="L":
      count+=1
    else:
      count+=0
if count==0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S=list(map(str,input()))
N=len(S)

count=0
for i in range(N):
  if i %2==0:
    if S[i]=="R"or"U"or"D":
      count=count+0
    else:
      count+=1
  if i %2==1:
    if S[i]=="L"or"U"or"D":
      count=count+0
    else:
      count+=1
if count==0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
s = list()
for a in S:
    s.append(a)

even = s[1::2]
odd = s[0::2]

if 'L' in even and 'R' in odd:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
s = list()
for a in S:
    s.append(a)

l1 = s[1::2]
l2 = s[0::2]

if 'L' in l1 and 'R' in l2:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

o = 'R'
e = 'L'

ans = 'Yes'

for a in S:
    if a == 'R':
        if (S.index(a)+1)%2 == 0:
            ans = 'No'
            break
        else:
            ans = 'Yes'
    if a == 'L':
        if (S.index(a)+1)%2 == 0:
            ans = 'Yes'
        else:
            ans = 'No'
            break

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
for i in range(len(s)):
  if i%2!=0 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:
S = input()
if S.count("R") == 0 and S.count("L") == 0:
	print("Yes")
elif S.count("R") > 0 and S.count("L") > 0:
	if S.index("R") % 2 == 0 and S.index("L") % 2 == 1:
		print("Yes")
	else:
		print("No")
elif S.count("R") > 0:
	if S.index("R") % 2 == 0:
		print("Yes")
	else:
		print("No")
else:
	if S.index("L") % 2 == 1:
		print("Yes")
	else:
		print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
t = 'LRUD'
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:
S=list(input().split())
N=len(S)

for i in range(0,N-1,2):
    if S[i]=="L" or S[i+1]=="R":
        print("No")
    else:
        print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
list = list(input())
a = ['L', 'U', 'D']
b = ['R', 'U', 'D']
isOK = True

for i, name in enumerate(list):
  if i % 2 == 1 and name not in a:
    print(name, i)
    isOK = False
  elif i % 2 == 0 and name not in b:
    isOK = False
  
print('Yes' if isOK else 'No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

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

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

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
count1 = 0
count2 = 0
for i in range(n//2+n%2):
    if s[i*2] == "R" or s[i*2] == "U" or s[i*2] == "D":
        count1 += 1
if count1 == n//2+n%2:
    for j in range (n//2):
        if s[j*2+1] == "L" or s[j*2+1] == "U" or s[j*2+1] == "D":
            count2 += 1
if count2 == n//2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
c1 = [s in ['R', 'U', 'D'] for s in S[::2]]
c2 = [s in ['L', 'U', 'D'] for s in S[1::2]]
print('Yes' if c1 and c2 else 'No')

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

S=list(ns())
S_o=''.join(S[0::2])
S_e=''.join(S[1::2])
print('Yes' if ((not ('R' in S_o)) and (not ('L' in S_e))) else 'No')

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

S=list(ns())
S_o=str(S[0::2])
S_e=str(S[1::2])
print('Yes' if (not (S_o in 'L')) and (not (S_e in 'R')) else 'No')

Submission status: Wrong Answer

Solution code:
# Your code here!
ODD = ['R', 'U', 'D']
EVEN = ['L', 'U', 'D']
s = input()

flg = False
for i in range(len(s)):
    if i % 2 == 1:
        if (s[i] in ODD) == False:
            flg = True
            break
    else:
        if (s[i] in EVEN) == False:
            flg = True
            break
        
if flg:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=list(str(input()))
odd=S[0::2]
even=S[1::2]
if (all(odd)=="R" or "U" or "D") and (all(even)=="L" or "U" or "D"):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
for i, s_ in enumerate(s, 1):
  if not ((i%2==1) and (s_ in ['R', 'U', 'D'])):
    print('No')
    exit()
  if not ((i%2==0) and (s_ in ['L', 'U', 'D'])):
    print('No')
    exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
for i, s_ in enumerate(s, 1):
  if not (i%2==1) and (s_ in ['R', 'U', 'D']):
    print('No')
    exit()
  if not (i%2==0) and (s_ in ['L', 'U', 'D']):
    print('No')
    exit()

print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()
n = len(S)

for i in range(int(n/2)):
    if S[2*i] != "R" and S[2*i] != "U" and S[2*i] != "D":
        print("No")
        exit()
for i in range(int(n/2)):
    if S[2*i + 1] != "L" and S[2*i + 1] != "U" and S[2*i + 1] != "D":
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s = list(input())

for i in range(0, len(s), 2):
    if s[i] == 'L':
        print('No')
        break

for j in range(1,len(s), 2):
    if s[j] == 'R':
        print('No')
        break

print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())
for i in range(0,len(S),2):
  if S[i] == 'R':
    print('No')
    exit()
for j in range(1,len(S),2):
  if S[j] == 'L':
    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" or i%2==1 and S[i]=="R":
        print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

res = "Yes"
for i in range(N):
  if i % 2 == 1:
    if S[i] == "L":
      res = "No"
  else:
    if S[i] == "R":
      res = "No"

print(res)

Submission status: Wrong Answer

Solution code:
od ="RUD"
ev="LUD"
res = "Y"
s = raw_input()
for i in xrange(len(s)):
    if i%2 ==0 :
        if s[i] not in od:
            res = "No"
            break
    else:
        if s[i] not in ev:
            res = "No"
            break
print res

Submission status: Wrong Answer

Solution code:
od ="RUD"
ev="LUD"
res = "YES"
s = raw_input()
for i in xrange(len(s)):
    if i%2 ==0 :
        if s[i] not in od:
            res = "NO"
            break
    else:
        if s[i] not in ev:
            res = "NO"
            break
print res

Submission status: Wrong Answer

Solution code:
#a,b = map(int,input().split())
#A = list(map(int,input().split()))
S = str(input())
if('L' in S[0::2] or 'R' in S[1::2]):
    print('No')
else:
    print('yes')

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
import re

S = input()

m1 = re.fullmatch(r"[RUD]+", S[::2])
m2 = re.fullmatch(r"[LUD]+", S[1::2])
if m1 and m2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

if set(S[::2]) == set("RUD") and set(S[1::2]) == set("LUD"):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
text = input()
s = list(text)
n = len(text)

i = 0


while i < n:
    if i % 2 == 0:
        if s[i] == "R" or "U" or "D":
            i += 1

        else:
            print("No")
            break


    elif i % 2 == 1:
        if s[i] == "L" or "U" or "D":
            i += 1
        else:
            print("No")
            break

if i == n:
    print("Yes")
else:
    print("NAZO")

Submission status: Wrong Answer

Solution code:
S = input()
ans_1 = False
ans_2 = False
for i in range (0, len(S), 2):
    if S[i] != "L":
        ans_1 = True
for j in range (1, len(S), 2):
    if S[j] != "R":
        ans_2 = True
if ans_1 and ans_2:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import numpy as np
S = input()
count = True
for i in np.arange(0, len(S), 2):
    if S[i] == "L":
        count = False
        
for i in np.arange(1, len(S), 2):
    if S[i] == "R":
        count += False

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

Submission status: Wrong Answer

Solution code:
def resolve():
    S = input()
    odd_flag = True

    for s in S:
        if odd_flag:
            if s == 'R' or s == 'U' or s == 'D':
                break
            else:
                print('No')
                return
        else:
            if s == 'L' or s == 'U' or s == 'D':
                break
            else:
                print('No')
                return
        odd_flag = not(odd_flag)

    print('Yes')

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    S = input()
    odd_flag = True

    for s in S:
        if odd_flag:
            if s == 'R' or s == 'U' or s == 'D':
                break
            else:
                print('No')
                return
        else:
            if s == 'L' or s == 'U' or s == 'D':
                break
            else:
                print('No')
                return

    print('Yes')

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    S = input()
    odd_flag = True

    for s in S:
        if odd_flag:
            if s == 'R' or s == 'U' or s == 'D':
                break
            else:
                print('No')
                return
        else:
            if s == 'L' or s == 'U' or s == 'D':
                break
            else:
                print('No')
                return


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
S = input()
index = 0
for n in S:
  if index % 2 == 0:
    if n == "R" or n == "U" or n == "D":
      pass
    else:
      print("No")
      exit()
  else:
    if n == "L" or n == "U" or n == "D":
      pass
    else:
      print("No")
      exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()

odd = s[::2]
print(odd)

even = s[1::2]
print(even)

if "R" in even or "L" in odd:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()

odd = s[::2]
print(odd)

even = s[1::2]
print(even)

if "R" in even:
    print("No")
elif "L" in odd:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()

odd = s[::2]
print(odd)

even = s[1::2]
print(even)

if "R" in even or "L" in odd:
     print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

flag = True
for i in range(len(s)):
    if i % 2 == 0 and i != 0:
        if s[i] in ['R','U','D']:
           pass
        else:
            flag = False
    else:
        if s[i] in ['L','U','D']:
            pass
        else:
            falg = False

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

Submission status: Wrong Answer

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

flag = True
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] in ['R', 'U','D']:
           pass
        else:
            flag = False
    else:
        if s[i] in ['L','U','D']:
            pass
        else:
            falg = False

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

Submission status: Wrong Answer

Solution code:
s = input()
kisuu = ['R', 'U', 'D']
guusuu = ['L', 'U', 'D']
for i in s[::2]:
    if i in kisuu:
        continue
    else:
        print('No')
        quit()
for j in s[1::2]:
    if j in guusuu:
        continue
    else:
        quit()
print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
kisuu = ['R', 'U', 'D']
guusuu = ['L', 'U', 'D']
for i in s[::2]:
    if i in kisuu:
        continue
    else:
        print('No')
        quit()
for j in s[2::2]:
    if j in guusuu:
        continue
    else:
        quit()
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s =input()

even = ["L", "U", "D"]
odd  = ["R", "U", "D"]
cnt = 1
result = "Yes"

for i in s:

    if cnt % 2 == 0:
        
        if not(i in even):
            result = "No"
            break
    else:
        if not(i in odd):
            result = "No"
            break
        
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
ans = "Yes"
for i in range(len(s)):
    if i & 2 == 0 and s[i] == "L":
        ans = "No"
        break
    elif i & 2 != 0 and s[i] == "R":
        ans = "No"
        break
print(ans)

Submission status: Wrong Answer

Solution code:
a = input()
n = int(len(a))
amari = int(n) % 2
flag = str()
if n == 1:
    if a == "L":
        print("No")
        flag = "unko"
    else:
        pass
elif amari == 0:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "L":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass

elif amari == 1:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "L":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass       
    if a[int(n) - 1] == "L" and flag == "":
        print("No")
        flag = "unko"
else:
    pass

if flag == "":
    print("Yes")

Submission status: Wrong Answer

Solution code:
a = input()
n = int(len(a))
amari = int(n) % 2
flag = str()
if n == 1:
    if a == "S":
        print("No")
        flag = "unko"
    else:
        pass
elif amari == 0:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "L":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass

elif amari == 1:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "L":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass       
    if a[int(n) - 1] == "S" and flag == "":
        print("No")
        flag = "unko"
else:
    pass

if flag == "":
    print("Yes")

Submission status: Wrong Answer

Solution code:
a = input()
n = int(len(a))
amari = int(n) % 2
flag = str()
if n == 1:
    if a == "S":
        print("No")
        flag = "unko"
    else:
        pass

elif amari == 0:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass

elif amari == 1:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass       
    if a[int(n) - 1] == "S" and flag == "":
        print("No")
        flag = "unko"
else:
    pass

if flag == "":
    print("Yes")

Submission status: Wrong Answer

Solution code:
a = input()
n = int(len(a))
amari = int(n) % 2
flag = str()
if amari == 0:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass

elif amari == 1:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass       
    if a[int(n) - 1] == "S" and flag == "":
        print("No")
        flag = "unko"
else:
    pass

if flag == "":
    print("Yes")

Submission status: Wrong Answer

Solution code:
a = input()
n = int(len(a))
amari = int(n) % 2
flag = str()
if amari == 0:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass

if amari == 1:
    for i in range (1, (int(n) // 2)):
        if a[int(i) * 2 - 2] == "S":
            print("No")
            flag = "unko"
            break
        elif a[int(i) * 2 - 1] == "R":
            print("No")
            flag = "unko"
            break
        else:
            pass       
    if a[int(n) - 1] == "S" and flag == "":
        print("No")
        flag = "unko"
if flag == "":
    print("Yes")

Submission status: Wrong Answer

Solution code:
even = ('L','U','D')
odd = ('R','U','D')

step = (even,odd)
s = input()
for i in range(len(s)):
  c = s[i]
  if c in step[i%2]:
    continue
  else:
    print('No')
    break
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()

odd = list(S[::2])
even = list(S[1::2])
xx = "No"
x1 = ""
x2 = ""
check = 0
check2 = 0

for i in range(len(odd)):
  
  if odd[i] == "R" or odd[i] == "U" or odd[i] == "D":
    check += 1
  
  if check == len(odd):
    x1 = "Y"
  
for i in range(len(even)):
 
  if even[i] == "L" or even[i] == "U" or even[i] == "D":
    check2 += 1
 
  if check2 == len(even):
    x2 = "Y"
  
  
if x1 == "Y" and x2 == "Y":
  xx = "Yes"
  
  
print(xx)