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()
ans='Yes'
for i in s[::2]:
        if i not in 'RUD':
                print(i)
                ans='No'
                break
for j in s[1::2]:
        if j not in 'LUD':
                ans='No'
                break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = str(input())

flag = False

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

if flag:
    print("Yes")
else:
    print("Np")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())

list_S_even =  [ c for c in S  if S.index(c)%2==1 ]
list_S_odd =  [ c for c in S  if S.index(c)%2==0 ]
#print(list_S_even)
#print(list_S_odd)

judge_aaa = True

for i in list_S_even:
    if i == "L" or i == "U" or i == "D":
        pass
    else:
        judge_aaa = False

for i in list_S_odd:
    if i == "R" or i == "U" or i == "D":
        pass
    else:
        judge_aaa = False

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

Submission status: Wrong Answer

Solution code:
S = input()

flag = False

# 偶数
for a in set(S[1::2]):
    # 奇数
    for b in set(S[::2]):
        if a == "L" or a == "U" or a == "D":
            if b == "R" or b == "U" or b == "D":
                flag = True
            else:
                flag = False
                break

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = list(input())

result = "No"

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

print(result)

Submission status: Wrong Answer

Solution code:
S = input()

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

hard = 0

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

Submission status: Wrong Answer

Solution code:
text = input()

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

Submission status: Wrong Answer

Solution code:
s = input()


for i,tap in enumerate(s):
        
        if i % 2 == 1:
                if tap == 'R':
                        print ('NO')
                        exit()
        else:
                if tap == 'L':
                        print ('NO')
                        exit()
else:
        print('YES')

Submission status: Wrong Answer

Solution code:
s = input()
count = 0

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

Submission status: Wrong Answer

Solution code:
S = input()

flag = False

# 偶数
for a in set(S[1::2]):
    # 奇数
    for b in set(S[::2]):
        if a == "L" or a == "U" or a == "D":
            if b == "R" or b == "U" or b == "D":
                flag = True
            else:
                flag = False
                
    if flag:
        break       

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

Submission status: Wrong Answer

Solution code:
s = list(input())
flag = True
for i, fs in enumerate(s):
    if not((i%2 == 0 and fs in ("L","U","D")) or (i%2 == 1 and fs in ("R","U","D"))):
        flag = False
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = input()
#print(len(s))
ans = 0
for i in range(len(s)):
    #print(i)
    if i+1 %2==0:
        if s[i] == 'R':
            #print('g')
            ans = 1
    if i %2==1:
        if s[i]== 'L':
            #print('k')
            ans=1

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

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
else:
  print("Yes")

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
    if i%2 == 1:
        if S[i] == 'R':
            print('No')
else: print('Yes')

Submission status: Wrong Answer

Solution code:
S = list(input())

result = "Yes"

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

print(result)

Submission status: Wrong Answer

Solution code:
td = input()
o = td[1::2]   # rud
e = td[::2]    # lud
if "L" in o or "R" in e:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
T = ['L', 'R']
s = str(input())
S = [s[i:i+1] for i in range(0, len(s), 1)]

j = 0
for j in range(0, len(S)-1, 2):
    if (S[j] == T[0]) or (S[j+1] == T[1]):
        print("No")
        exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
count = 0

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

Submission status: Wrong Answer

Solution code:
s = input()
o = s[::2]
e = s[1::2]

co = 'L' in o
ce = 'R' in e

if co or ce:
  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 and s[i]=='L' or s[i]=='U' or s[i]=='D':
        count = 1
    else:
        count = 0
        break
    
for i in range(len(s)):
    if i%2!=0 and s[i]=='R' or s[i]=='U' or s[i]=='D':
        count2 = 1
    else:
        count2 = 0
        break

if count ==1 and count2==1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

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

if i == len(s)-1:
	print("Yes")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    for index, s in enumerate(S):
        if index % 2 == 0:
            if s == 'L':
                print('No')
                break
        else:
            if s == 'R':
                print('No')
                break
    if index == len(S) - 1:
        print('Yes')



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
def main():
    S  = input()
    O_flag = 0
    E_flag = 0
    for i in range(0, len(S),2):
        if S[i]=="R" or S[i]=="U" or  S[i]=="D":
            O_flag = 1
            break
    for i in range(1, len(S),2):
        if S[i]=="L" or S[i]=="U" or  S[i]=="D":
            E_flag = 1
            break
    if O_flag ==1 and E_flag ==1:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = list(input())

f = "True"
for i,j in enumerate(s):
  if i % 2 == 1:
    if j == "L" or j == "U" or j == "D":
      continue
    else:
      print("No")
      f = "False"
      break
  elif i % 2 == 0:
    if j == "R" or j == "U" or j == "D":
      continue
    else:
      print("No")
      f = "False"
      break

if f:
  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')
        break
    if i % 2 == 1 and S[i] == 'R':
        print('No')
        break
print('Yes')

Submission status: Wrong Answer

Solution code:
S = list(input())

even_list = ['R', 'U', 'D']
odd_list = ['L', 'U', 'D']

is_even = all(list(map(lambda x: x in even_list, S[1::2])))
is_odd = all(list(map(lambda x: x in odd_list, S[0::2])))

if is_even and is_odd:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S=input()
n=len(S)
hantei1='No'
hantei2='No'
for i in range(0,n,2):
    if S[i]=='R' or S[i]=='U' or S[i]=='D':
        hantei1='Yes'
    else:
        hantei1='No'
        break

for j in range(1,n,2):
    if S[j]=='L' or S[j]=='U'or S[j]=='D':
        hantei2='Yes'
    else:
        hantei2='No'
        break

if hantei1=='Yes' and hantei2=='Yes':
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import collections
S = input()

even = collections.defaultdict(int)
odd = collections.defaultdict(int)

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

odd = list(odd.keys())
even = list(even.keys())

if "R" in odd:
    if odd.index("R") >= 0:
        odd.pop(odd.index("R"))
if "U" in odd:
    if odd.index("U") >= 0:
        odd.pop(odd.index("U"))
if "D" in odd:
    if odd.index("D") >= 0:
        odd.pop(odd.index("D"))

if len(odd) != 0:
    print("No")
    exit(0)

if "L" in even:
    if even.index("L") >= 0:
        even.pop(even.index("L"))
if "U" in even:
    if even.index("U") >= 0:
        even.pop(even.index("U"))
if "D" in even:
    if even.index("D") >= 0:
        even.pop(even.index("D"))

if len(odd) != 0:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
count = 1

n = len(s)

for i in s:
    if count == n:
        print('Yes')
        break
    if i == 'U' or i == 'D':
        count += 1
    elif count % 2 == 1:
        if i == 'L':
            print('No')
            break
        count += 1
    elif count % 2 == 0:
        if i == 'R':
            print('No')
            break
        count += 1

Submission status: Wrong Answer

Solution code:
s=input()

if len(s)==1:
  if s[0]=="R":
    print("No")
    exit()
  else:
    print("Yes")
    exit()

for i in range(len(s)//2):
  if s[2*i]=="L":
    print("No")
    exit()
  elif s[2*i+1]=="R":
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()

isEasy = True
for i, v in enumerate(S):
  if (i % 2 == 1 and v == 'L' or v == 'U' or v == 'D'):
    pass
  else:
    isEasy = False
  if (i % 2 == 0 and v == 'R' or v == 'U' or v == 'D'):
    pass
  else:
    isEasy = False

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

Submission status: Wrong Answer

Solution code:
def main():
  s = input()
  if is_easy(s):
    print("Yes")
  else:
    print("No")

def is_easy(str):
  for i in range(len(str)):
    c = str[i]
    mod = i % 2

    if mod == 0:
      if c == "R":
        return False
    else:
      if c == "L":
        return False

  return True

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s = list(input())
yn = 0

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
def main():
    input = sys.stdin.readline
    S = input()
    s_len = len(list(S))
    for i in range(s_len):
        s = S[i]
        ans = "Yes"
        if s == "U" or s == "D":
            pass
        else:
            if i % 2 == 0:
                if s == "R":
                    pass
                else:
                    ans = "No"
                    break
            else:
                if s == "L":
                    pass
                else:
                    ans = "No"
                    break

    print(ans)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S = input()

if len(S) % 2 == 1:
	for i in S[0::2]:
		if i == "L":
			print("No")
			break
		for j in S[1:len(S)-1:2]:
			if j == "R":
				print("No")
				break
	else:print("Yes")
	
if len(S) % 2 == 0:
	for i in S[0:len(S)-1:2]:
		if i == "L":
			print("No")
			break
		for j in S[1::2]:
			if j == "R":
				print("No")
				break
	else:print("Yes")

Submission status: Wrong Answer

Solution code:
s = str(input())
ans = 'Yes'
print(list(s))
for i in list(s)[0::2]:
    if i == 'L':
        ans = 'No'
for i in list(s)[1::2]:
    if i == 'R':
        ans = 'No'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

odd = True
yes = True

for s in S:
    if odd:
        if s == "L":
            yes = False
            break
        odd = False
    else:
        if s == "R":
            yes = False
            break
        odd = True

print(S)

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

Submission status: Wrong Answer

Solution code:
s=input()
o=["R","U","D"]
e=["L","U","D"]
i=0
for t in range(len(s)):
  if(i==1):
    break
  if t%2==1:
    if(t not in o):
      print("No")
      i=1
  else:
    if(t not in e):
      print("No")
      i=1
if(i==0):
	print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()

even = set(S[1::2])
odd = set(S[::2])


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

Submission status: Wrong Answer

Solution code:
#B
s = input()
L = 'L'
R = 'R'
odds = ''
evens = ''
for i in range(len(s)):
    if i % 2 == 0:
        odds += s[i]
    else:
        evens += s[i]
if (L in odds) or ((evens == '') or (R in evens)):
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

s = input()
a = list(range(len(s)))

for i in range(len(a)):
    if a[i] % 2 == 0:
        if s[a[i]] == 'L':
            print('No')
            sys.exit()
    else:
        if s[a[i]] == 'R':
            print('NO')
            sys.exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()

isEasy = True
for i, v in enumerate(S):
  if (i % 2 == 1 and v == 'L' or v == 'U' or v == 'D'):
    isEasy = True
  else:
    isEasy = False
  if (i % 2 == 0 and v == 'R' or v == 'U' or v == 'D'):
    isEasy = True
  else:
    isEasy = False

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

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==1 and s[i]=='R'):
		ans="NO"
		break
print(ans)

Submission status: Wrong Answer

Solution code:
import sys


def iseven(x):
    return True if not x % 2 else False


n = list(input())
lil = []
lir = []
for i in range(len(n)):
    if n[i] == 'L':
        lil.append(n.index(n[i]) + 1)
    elif n[i] == 'R':
        lir.append(n.index(n[i]) + 1)
lil = list(map(iseven, lil))
lir = list(map(iseven, lir))
for i in lil:
    if not i:
        print("No")
        sys.exit()
for i in lir:
    if i:
        print("No")
        sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input().split())

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

print('Yes')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
 
def main():
    S = input()
    ans = 'Yes'
    for i in range(len(S)):
        if (i+1)%2==1:
            if S[i:i+1] not in ['R', 'U', 'D']:
                ans = 'No'
                break
        else:
            if S[i:i+1] not in ['L', 'U', 'D']:
                ans = 'No'
                break
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=str(input())
ans='Yes'
i=0
while 2*i+1<len(s):
	if s[2*i]=='L':
		ans='No'
	if s[2*i+1]=='R':
		ans='No'
	i+=1
print(ans)

Submission status: Wrong Answer

Solution code:
s = [i for i in input().split()]
s_list = list(s)

print(s_list)

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=c+1

else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
import sys

s = input()
a = list(range(len(s)))
print(a)

for i in range(len(a)):
    if a[i] % 2 == 0:
        if s[a[i]] == 'L':
            print('No')
            sys.exit()
    else:
        if s[a[i]] == 'R':
            print('NO')
            sys.exit()
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

S = input()

odd = 'R'
even = 'L'

end = len(S)

flag = True
for i in range(0, end, 2):
    if S[i] == even:
        flag = False
    
    
for i in range(1, end, 2):
    if S[i] == odd:
        flag = False
    
    
if flag:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
odd = [ "R", "U", "D"]
add = ["L", "U", "D"] 
ans = 1

S = input()
for i,s in enumerate(S):
  if i%2 == 0:
    if (s in add) == False:
      ans = 0
  else:
    if (s in odd) == False:
      ans = 0
      
if ans == 0:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
def main():

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s=input()
flag1,flag2=True,True
n=len(s)
for i in range(0,n,2):
  if s[i] == "R" or s[i] =="U" or s[i] =="D":
    flag1=True
  else:
    flag1=False
for i in range(1,n,2):
  if s[i] == "L" or s[i] =="U" or s[i] =="D":
    flag2=True
  else:
    flag2=False
if flag1 == True and flag2 == True:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s = str(input())

o = ['R','U','D']
e = ['L','U','D']
flag = 0
for idx ,i in enumerate(s):
  if (idx+1)%2 == 0 and not i in e:
    print('NO')
    flag = 1
    break
  if (idx+1)%2 != 0 and not i in o:
    print('NO')
    flag = 1
    break
if flag == 0:
  print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
odd = ["R","U","D"]
even = ["L","U","D"]
flag1=True
flag2=True
for i in range(1,len(s)+1):
    if (i%2==1) and not(s[i-1] in odd):
        flag1 =False
    if (i%2==0) and not(s[i-1] in even):
        flag2 = False

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

S = input()

N = len(S)

Ans = 1

for i in range(N):
  nTmp = (i+1) % 2
  
  if nTmp == 1 and S[i]=='L':
    Ans = 0
  if nTmp == 0 and S[i]=='R':
    Ans = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from sys import stdin
import math

# 標準入力をスペースで区切って、intに変換 listに収納
str_list  = stdin.readline().rstrip()


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


for i in range(len(str_list)):
    # 0から始まるので奇数なら偶数の配列を確かめる
    if i % 2 == 0:
        if str_list[i] in kisu:
            pass
        else:
            ans='no'
            break

    else:
        if str_list[i] in gusu:
            pass
        else:
            ans='no'
            break
else:
    ans='yes'

print(ans)

Submission status: Wrong Answer

Solution code:
s = str(input())

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

Submission status: Wrong Answer

Solution code:
S  = list(input())
print(len(S))
index_even = ['R','U','D']
index_odd = ['L','U','D']
cnt_odd = 0
cnt_even = 0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] in index_even:
            cnt_even += 1
    else:
        if S[i] in index_odd:
            cnt_odd += 1
if (cnt_even + cnt_odd) == len(S):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def func():
    S = input()

    ans = 'Yes'
    for i in range(len(S)):
        if i % 2 != 0 and S[i] == 'R':
            ans = 'No'
            break

        elif S[i] == 'L':
            ans = 'No'
            break
    
    print(ans)

if __name__ == '__main__':
    func()

Submission status: Wrong Answer

Solution code:
S = input()

evenS=[]
oddS=[]

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

if('R' in evenS) or ('L' in oddS):
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()

for i in range(len(S)):
    if i % 2 == 0:
        if not S[i] in ('R', 'U', 'D'):
            print("No")
            break
    else:
        if not S[i] in ('L', 'U', 'D'):
            print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
s=input()
o=["R","U","D"]
e=["L","U","D"]

for t in range(len(s)):
  if t%2==1:
    if(t not in o):
      print("No")
      break
  else:
    if(t not in e):
      print("No")
      break
print("Yes")

Submission status: Wrong Answer

Solution code:
s=input()

for i in range(len(s)//2):
  if s[2*i]=="L":
    print("No")
    exit()
  elif s[2*i+1]=="R":
    print("No")
    exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
s = str(input())

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

Submission status: Wrong Answer

Solution code:
S = input()

for i in range(0, len(S), 2):
    if not (S[i] == 'L' or S[i] == 'U' or S[i] == 'D'):
        print('No')
        quit()

for i in range(1, len(S), 2):
    if not (S[i] == 'R' or S[i] == 'U' or S[i] == 'D'):
        print('No')
        quit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()

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

print('Yes')

Submission status: Wrong Answer

Solution code:
import sys
s=input()
l=len(s)
for i in range(0,l,2):
  if s[i]=='R':
    print('No')
    sys.exit()
for j in range(1,l,2):
  if s[j]=='L':
    print('No')
    sys.exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
odd = ["R","U","D"]
even = ["L","U","D"]
flag1=True
flag2=True
for i in range(1,len(s)+1):
    if (i%2==1) and not(s[i-1] in even):
        flag1 =False
    if (i%2==0) and not(s[i-1] in odd):
        flag2 = False

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

Submission status: Wrong Answer

Solution code:
import sys
a = list(input())
print(a)
for i in range(len(a)):
    if i%2 == 0:
        if a[i] == 'L':
            print('No')
            sys.exit()
    else:
        if a[i] == 'R':
            print('No')
            sys.exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()

od = ["R","U","D"]
ev = ["L","U","D"]

b = False
for i in range(len(s)):
  if i%2==0 and (s[i] not in ev):
      b = True
      break
  elif i%2==1 and (s[i] not in od):
      b = True
      break

if b:
  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')
        exit(0)
    if i%2 == 1 and s[i] == 'L':
        print('No')
        exit(0)
print('Yes')

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=sys.stdin.readline
def resolve():
    E={'R','U','D'}
    O={'L','U','D'}
    S=list(input())
    if set(S[::2])<=E and set(S[1::2])<=O:
        print("Yes")
    else:
        print("No")

resolve()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(int(1e6))

S = input()

for i in range(len(S)):
    if i % 2:
        # 奇数番目
        if S[i] == 'L':
            print('No')
            exit()
    else:
        # 偶数番目
        if 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 == 1:
    if s[i] == 'L':
      print('No')
  else:
    if s[i] == 'R':
      print('No')

print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()

p = 0

for i in range(len(S)):
  if i // 2 == 0:
    if S[i] == 'L':
      p += 1
  elif i // 2 == 1:
    if S[i] == 'R':
      p += 1
  if p == 1:
    break
      
if p != 0:
  print('No')
elif p == 0:
  print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
n = 1
a = True
for c in s:
    if n % 2 == 0:
        if c == "L" or c == "U" or c == "D":
            continue
        else:
            a = False
            break
    else:
        if c == "R" or c == "U" or c == "D":
            continue
        else:
            a = False
            break
if a:
    print("Yes")
else:
    print("No")