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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=list(input())

s_odd=s[0::2] 
s_even=s[1::2]

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

Submission status: Runtime Error

Solution code:
import numpy as np

even_array = np.array(["R", "U", "D"])
odd_array = np.array(["L", "U", "D"])

S = input()
S = np.array(list(S))

even_list = list(range(0, len(S), 2))
odd_list = list(range(1, len(S), 2))

if all([all(np.isin(S[even_list], even_array)),all(np.isin(S[odd_list], odd_array))]):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s = input()

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

print("Yes")

Submission status: Runtime Error

Solution code:
s=list(input())
while i<range(s):
  if s[2*i+1]=='L' or s[2*i]=='R':
    print('No')
  else:
    print('Yes')

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

Solution code:
s=list(input())
while i<range(s):
  if s[2i+1]=='L' or s[2i]=='R':
    print('No')
  else:
    print('Yes')

Submission status: Runtime Error

Solution code:
def lcs(s1, s2):
    dp = []
    for s2_k in s2:
        bgn_idx = 0
        for i, cur_idx in enumerate(dp):
            chr_idx = s1.find(s2_k, bgn_idx) + 1
            if not chr_idx:
                break
            dp[i] = min(cur_idx, chr_idx)
            bgn_idx = cur_idx
        else:
            chr_idx = s1.find(s2_k, bgn_idx) + 1
            if chr_idx:
                dp.append(chr_idx)
    return len(dp)

def solve():
    N = int(input())
    S = input()
    ans = 0
    for i in range(1,N):
      S1 = S[:i]
      S2 = S[i:]
      ans = max(ans,lcs(S1, S2))
    print(ans)

if __name__ == '__main__':
    solve()

Submission status: Runtime Error

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

Submission status: Runtime Error

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 if i ==n:
        print("No")

Submission status: Runtime Error

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: Runtime Error

Solution code:
s=list(input())
while i<range(s):
  if s[2i+1]=='L' or s[2i]=='R':
    print('Yes')
  else:
    print('No')

Submission status: Runtime Error

Solution code:
s_odd=list(A=input())[0::2]
s_even=list(A)[1::2]
if s_odd.find('L')==-1 and s_even.find('R')==-1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

even_array = np.array(["R", "U", "D"])
odd_array = np.array(["L", "U", "D"])

S = np.array(list(input()))

even_list = list(range(0, len(S), 2))
odd_list = list(range(1, len(S), 2))

if all([all(np.isin(S[even_list], even_array)),all(np.isin(S[odd_list], odd_array))]):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s = input()
k = s[::2]
g = s[1::2]

if k == "R","U","D" and g == "L","U","D":
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
s=list(input())

s_odd=s[0::2] 
s_even=s[1::2]

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
even = ["L","U","D"]
odd = ["R","U","D"]
f=True
for i in range(len(s)):
    if i%2==1:
        if s[i] not in even:
            f = False
    if i%2==0:
        id s[i] not in odd:
            f=False
if f:
    peint("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
s=list(input())

s_odd=s[0::2]
s_even=s[1::2]

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

Submission status: Runtime Error

Solution code:
s=input()
N=len(s)
a="Yes"

for i in range (0,N):
  if i%2=0:
    if (s[i]!="R") and (s[i]!="U") and (s[i]!="D"):
      a="No"
      break
  else:
    if (s[i]!="L") and (s[i]!="U") and (s[i]!="D"):
      a="No"
      break
print(a)

Submission status: Runtime Error

Solution code:
input0=input("")
b=2
i=0

c=input0[::2]
d=input0[1::2]

for a in c:
    if(a=="L"):
        b=1
    else:
        b=0
    e=+b
    
for a in d:
    if(a=="R"):
        b=1
    else:
        b=0
    f=+b

g=e+f
if(g==0):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
  inputstr = input()
  size = len(inputstr)

  isEasy = True

  for i in range(size):
    if i % 2 == 0:
      if inputstr[i] in ["R", "U", "D"]:
      else:
        isEasy = False
        break
    else:
      if inputstr[i] in ["L", "U", "D"]:
      else:
        isEasy = False
        break

  if isEasy = True:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input()
n=len(a)
e=[i for i in range(n) if i%2==0]
o=[i for i in range(n) if i%2!=0]

for x in e:
    c=0
    if a[x-1] in ["R","U","D"]:
        c=1
for y in o:
    d=0
    if a[x-1] in ["L","U","D"]:
        d=1
if c==1 or d==1:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
a=input()
n=len(a)
e=[i for i in range(n) if i%2==0]
o=[i for i in range(n) if i%2!=0]

for x in e:
    c=0
    if a[x-1] in ["R","U","D"]:
        c=1
for y in o:
    d=0
    if a[x-1] in ["R","U","D"]:
        d=1
if c==1 or d==1:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
S=str(input())
for i in range(len(S)):
  if i%2==0:
    S.replace("R","Q")
  else:
    S.replace("L","Q")
S.replace("U","")
S.replace("D","")
S.replace("Q","")
if S="":
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

N = len(S)

for i in range(N//2):
    if (S[i*2] == 'R' or S[i*2] == 'U' or S[i*2] == 'D') and \
            (S[i*2 + 1] == 'L' or S[i*2 + 1] == 'U' or S[i*2 + 1] == 'D'):
        continue
    else:
        print('No')
        exit(1)
if N%2 != 0:
    if S[N-1] == 'R' or S[N-1] == 'U' or S[N-1] == 'D':
        print('Yes')
    else:
        print('No')
        exit(1)
else:
    print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()

n = len(S)//2
i = 0
T = "True"

while i<=n:
    if S[i] is not "L" and S[i+1] is not "R":
        i = i + 2
    else:
        print("No")
        T = "False"
        break

if T == "True":
    print("Yes")
else:
    pass

Submission status: Runtime Error

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

N = len(S)
cnt = 0
#odd_S = S[1::2]
#even_S = S[0::2]
for i in range(N//2):
    if (S[i*2] == 'R' or S[i*2] == 'U' or S[i*2] == 'D') and \
            (S[i*2 + 1] == 'L' or S[i*2 + 1] == 'U' or S[i*2 + 1] == 'D'):
        continue
    else:
        print('No')
        exit(1)
if N%2 != 0:
    if S[N-1] == 'R' or S[N-1] == 'U' or S[N-1] == 'D':
        print('Yes')
    else:
        print('No')
        exit(1)
else:
    print('Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

Dance = input()
i = 0
flag = 0
for char in Dance:
  if i%2 == 0:
    if char == R:
      flag = 1
      break
  else:
    if char == L:
      flag = 1
      break
  i+=1
  
if flag == 0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()

def evenjudge(obj):
    if obj %2!=0:
        return 1
    else:
        return 2
def oddjudge(obj):
    if obj %2!=0:
        return 2
    else:
        return 1

lo=[i for i in range(0,110,2)]
le=[i for i in range(1,110,2)]

oeflag=evenjudge(len(s))
eoflag=oddjudge(len(s))
for j in lo:
    if s[j] == "L":
        print("No")
        exit(0)
    if j == len(s)-oeflag:
        break


for k in le:
    if s[k] == "R":
        print("No")
        exit(0)
    if k == len(s)-eoflag:
        break


print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()

length = len(S)
for i in range(length):
    if (i + 1) % 2 == 0:
        global evenN
        if S[i] == 'R':
            evenN = False
        else:
            evenN = True
    if (i + 1) % 2 == 1:
        global oddN
        if S[i] == 'L':
            oddN = False
        else:
            oddN = True


if oddN is True and evenN is True:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
S = input()

flag = 'Yes'
for i in range(len(S)):
    if i%2 == 0:
        if S[i] == 'R' or S[i] == 'U' or S[i] == 'D':
            pass
        else:
            flag = 'No'
            break
    if i%2 == 1:
        if S[i] == 'L' or S[i] == 'U' or S[i] == 'D':
            pass
        else:
            flag = 'No'
            brake

print(flag)

Submission status: Runtime Error

Solution code:
s = input()
ans = 1

for i in range(len(s)):
  if i % 2 == 0:
    if s[i] != 'R' OR 'U' OR 'D':
      ans -= 1
  else:
    if s[i] != 'L' OR 'U' OR 'D':
      ans -= 1
      
if ans < 1:
  print("No")
else: print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
c = 0
s.append("U")

for i in range(-(-l//2)):
    d = 2*i
    if s[d] == "L":
        print("No")
        c = 1
        break
    if s[d+1] == "R":
        print("No")
        c = 1
        break
if c == 0:
    print("Yes")

Submission status: Runtime Error

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

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
str = input()

list = str.split()

odd=["R","U","D"]
even=["L","U","D"]

i = 1
flag = False
for l in list:
    if i % 2 == 0:
        if l in even:
            pass
        else:
            flag = True
            break
    else:
        if l in odd:
            pass
        else:
            flag = True
            break
if(flag):
    print(No)
else:
    print(Yes)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
S = input()

l = len(S)
for i in range(l):
    if (i + 1) % 2 == 0:
        if S[i] == 'R':
            even = False
        else:
            even = True
    if (i + 1) % 2 == 1:
        if S[i] == 'L':
            odd = False
        else:
            odd = True


if odd == True and even == True:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

N = int(input())
H = list(map(int, input().split()))
D = [0, abs(H[1] - H[0])]
for i in range(2, N):
    D.append(min(abs(H[i] - H[i - 1]) + D[i - 1], abs(H[i] - H[i - 2]) + D[i - 2]))
print(D[-1])

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

            a=list()
b=list()
a="R", "U","D"
b="L", "U", "D"
s=input()
count=0
ans=True
for i in s:
    if count%2==0:
        if i not in a:
            ans=False
    if count%2!=0:
        if i not in b:
            ans=False
    count+=1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
strlist = input().rstrip().split("")
evenset = set()
oddset = set()
 
for i in range(len(strlist)):
  if i % 2 == 0:
    oddset.add(strlist[i])
  else:
    evenset.add(strlist[i])
 
if (oddset <= {"R", "U", "D"} and evenset <= {"L", "U", "D"}):
  print("Yes")
 
else:
  print("No")

Submission status: Runtime Error

Solution code:
n = str(input())
d = []
p = []
i = 1
s = 1
l = 1
for k in n:
 if i % 2 == 0:
  if k == "R" or k == "U" or k == "D":
   #print(k,"は満たしています")
  else:
   #print("偶数","みたしていない")
   s = 0
 else:
  if k == "L" or k == "U" or k == "D":
   #print("奇数","番目の",k)
  else:
    #print("奇数","みたしていない")
    l = 0
 i = i + 1
if s or l == "1":
 print("Yes")
else:
 print("No")

Submission status: Runtime Error

Solution code:
S = list(input())

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

for i in range(len(Odd)):
    if 'L' == Odd[i]:
        c = 0
    else:
        for j in range(len(Even)):
            if 'R' == Even[j]:
                c = 0
            else:
                c = 1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
strlist = input().rstrip().split("")
evenset = set()
oddset = set()
 
for i in range(len(strlist)):
  if i % 2 == 0:
    evenset.add(strlist[i])
  else:
    oddset.add(strlist[i])
 
if (oddset <= {"R", "U", "D"} and evenset <= {"L", "U", "D"}):
  print("Yes")
 
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

N = input()
steps = [i for i in N]
N = len(N)
ans = "Yes"
#024 L があるとダメ
for i in range(0,N+1,2):
    if steps[i] == "L":
        ans = "No"
for i in range(1,N,2):
    if steps[i] == "R":
        ans = "No"
print(ans)

Submission status: Runtime Error

Solution code:
strlist = input().rstrip().split("")
evenset = set()
oddset = set()

for i in range(len(strlist)):
  if i % 2 == 0:
    evenset.add(setlist[i])
  else:
    oddset.add(setlist[i])

if (oddset <= {"R", "U", "D"} and evenset <= {"L", "U", "D"}):
  print("Yes")

else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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")
elif:
    print("No")

Submission status: Runtime Error

Solution code:
string = input()

def jadge_humiyasui(string):
    for i, str in enumerate(string):
        if i % 2 == 0:
            label1 = str in ['R', 'U', 'D']
        else:
            label2 = str in ['L', 'U', 'D']

    if label1 & label2:
        print('Yes')
    else:
        print('No')

jadge_humiyasui(string)

Submission status: Runtime Error

Solution code:
/*
    Converted from Scratch by scratch2cpp (https://github.com/yos1up/scratch2cpp).
*/
#include <iostream>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#define debug cerr << "--" << __LINE__ << "--" << "\n"
typedef long long ll;
using namespace std;

class Var{ // NOTE: immutable
public:
    mutable string sval;
    mutable long double dval;
    enum NumericState {UNKNOWN = -1, STRINGY = 0, NUMERIC = 1};
    mutable NumericState numericState;
    mutable bool svalValid, dvalValid; // TODO: initialize at here?

    Var(){
        *this = Var("");
    }
    Var(string s){
        sval = s;
        svalValid = true; dvalValid = false;
        numericState = UNKNOWN;
    }
    Var(long double d){
        dval = d;
        svalValid = false; dvalValid = true;
        numericState = NUMERIC;
    }
    Var(const Var &v){
        sval = string(v.sval); dval = v.dval;
        svalValid = v.svalValid; dvalValid = v.dvalValid;
        numericState = v.numericState;
    }
    void fillDval() const{
        if (dvalValid) return;
        double d;
        bool numeric = isNumericString(sval, &d);
        if (numeric){
            numericState = NUMERIC;
            dval = d;
        }else{
            numericState = STRINGY;
            dval = 0.0;
        }        
        dvalValid = true;
    }
    static bool isNumericString(const string &s, double *ptr) {
        char* ep;
        // cause side-effect: errno can be ERANGE after calling strtod
        *ptr = strtod(s.c_str(), &ep);
        // TODO: support long double (with strtold)
        // Scratch 3.0 recognize the string cause underflows or overflows as Numeric
        return NULL != ep && '\0' == ep[0] && s[0] != '\0';
    }
    bool isNumeric() const{
        fillDval();
        return numericState == NUMERIC;
    }    
    void fillSval() const{
        if (svalValid) return;
        sval = (floor(dval) == dval) ? to_string((ll)dval) : to_string(dval);
        svalValid = true;
    }       
    long double asNumber() const{
        fillDval();
        return dval;
    } 
    string asString() const{
        fillSval();
        return sval;
    }
    Var operator+(const Var &y) const{
        return Var(this->asNumber() + y.asNumber());
    }
    Var operator+=(const Var &y){
        *this = *this + y;
        return *this;
    }
    Var operator-(const Var &y) const{
        return Var(this->asNumber() - y.asNumber());
    }
    Var operator*(const Var &y) const{
        return Var(this->asNumber() * y.asNumber());
    }
    Var operator/(const Var &y) const{
        return Var(this->asNumber() / y.asNumber());
    }
    Var operator%(const Var &y) const{
        return Var(fmod(this->asNumber(), y.asNumber()));
    }
    bool operator<(const Var &y) const{
        if (this->isNumeric() && y.isNumeric()){
            return this->asNumber() < y.asNumber();
        } // compare as number if both can be interpreted as numeric
        return this->asString() < y.asString();
    }
    bool operator>(const Var &y) const{
        return y < *this;
    }
    bool operator==(const Var &y) const{
        if (this->isNumeric() && y.isNumeric()){
            return this->asNumber() == y.asNumber();
        } // compare as numeric if both are numeric
        return this->asString() == y.asString();
    }
    friend ostream& operator << (ostream& os, const Var& p);
    friend istream& operator >> (istream& is, const Var& p);
};
ostream& operator << (ostream& os, const Var& p){
    os << p.asString();
    return os;
}
istream& operator >> (istream& is, Var& p){
    string s; is >> s; p = Var(s);
    return is;
}


Var letterOf(Var index, Var sourceString){
    /* index: 1-origined */
    string str = sourceString.asString();
    int idx = (int)(index.asNumber() - 1);
    // seem to be dirty but Scratch seems to do like this.
    // ex. letterOf(0.01, "world") == "w", letterOf(1.99, "world") == "w", letterOf(5.99, "world") == "d"
    if (0 <= idx && idx < str.size()) return Var(str.substr(idx, 1));
    return Var();
}

class VarList{
public:
    vector<Var> data;
    VarList(const vector<Var> &x) { data = x; }
    void push_back(const Var &x){ data.push_back(x); }
    void pop_back(){ data.pop_back(); }
    void clear(){ data.clear(); }
    int size(){ return (int) data.size(); }
    Var getLineOfList(const Var &index) const{
        /* index: 1-origined */
        int idx = (int)index.asNumber() - 1;
        // (unlike 'letterOf', index==0.9 does not work.)
        if (0 <= idx && idx < data.size()) return data[idx];
        return Var();
    }
    void setLineOfListTo(const Var &index, const Var &v){
        /* index: 1-origined */
        int idx = (int)index.asNumber() - 1;
        if (0 <= idx && idx < data.size()) data[idx] = v;
    }
    void deleteLineOfList(const Var &index){
        /* index: 1-origined */
        string kwd = index.asString();
        if (kwd == "all"){
            data.clear();
        }else if (kwd == "last"){
            data.pop_back();
        }else{
            int idx = (int)index.asNumber() - 1;
            if (0 <= idx && idx < data.size()) data.erase(data.begin() + idx);
        }
    }
    void insertAtIndexOfList(const Var &item, const Var &index){
        /* index: 1-origined */
        int idx = (int)index.asNumber() - 1;
        if (0 <= idx && idx <= data.size()) data.insert(data.begin() + idx, item);   
    }
    void insertAtRandomOfList(const Var &item){
        int idx = rand() % (data.size() + 1);
        data.insert(data.begin() + idx, item);
    }
    string asString() const{
        /* concatenate elements of list with space */
        // TODO: concatenated without spaces only if all elements are single characters.
        // (Is it an official bug? (or feature?))
        string ret;
        for(int i=0;i<data.size();i++){
            if (i > 0) ret += ' ';
            ret += data[i].asString();
        }
        return ret;        
    }
    int itemNumOfList(const Var &item) const{
        auto itr = find(data.begin(), data.end(), item);
        if (itr == data.end()) return 0;
        return 1 + (int)(itr - data.begin());
        /* index: 1-origined */
    }
    friend ostream& operator << (ostream& os, const VarList& p);
};
ostream& operator << (ostream& os, const VarList& p){
    os << p.asString();
    return os;
}

long double randUniform(const long double x, const long double y){
    if (x > y) return randUniform(y, x);
    if (floor(x) == x && floor(y) == y){
        ll xi = (ll)round(x), yi = (ll)round(y);
        return xi + rand() % (yi - xi + 1);
    }else{
        return x + (y - x) * (0.0 + rand()) / RAND_MAX;
    }
}

Var buf_answer; // for "answer"

// ============================= Scripts =============================

// variable declaration
Var var_i(16);
Var var_s("UUUUUUUUUUUUUUU");

// list declaration

// prototype declaration of functions
int main();

// contents of functions
int main(){
    cin >> buf_answer;
    var_s = buf_answer;
    var_i = Var(1);
    for (int cnt_0=0;cnt_0<Var(var_s.asString().size()).asNumber();cnt_0++){
        if (((var_i % Var(2)) == Var(1))){
            if (((letterOf(var_i, var_s) == Var("R")) || ((letterOf(var_i, var_s) == Var("U")) || (letterOf(var_i, var_s) == Var("D"))))){
                var_i += Var(1);
            } else {
                cout << Var("No") << endl;
                return 0;
            }
        } else {
            if (((letterOf(var_i, var_s) == Var("L")) || ((letterOf(var_i, var_s) == Var("U")) || (letterOf(var_i, var_s) == Var("D"))))){
                var_i += Var(1);
            } else {
                cout << Var("No") << endl;
                return 0;
            }
        }
    }
    cout << Var("Yes") << endl;
    return 0;
}

Submission status: Runtime Error

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] != 'U' and text[i:i+1] and 'U' and text[i:i+1] != 'D':
			flg = 1
if flg == 1:
	print('No')
else:
	pring('Yes')

Submission status: Runtime Error

Solution code:
S = list(input())
flag = True
for i in range(0, int(len(S) / 2 + 1), 2):
    if S[i] == 'L':
        flag = False
    if S[i + 1] == 'R':
        flag = False

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
S = input()

for s in S[0::2]:
    if s != 'R' and s != 'U' and s != 'D':
        print('No')
        quit()

for s in S[1::2]:
    if S[i] != 'L' and S[i] != 'U' and S[i] != 'D':
        print('No')
        quit()

print('Yes')

Submission status: Runtime Error

Solution code:
S=str(input())
ans="Yes"
for i,s in S:
  if i%2==0:#odd
    if s=="L":
      ans="No"
  else:#even
    if s=="R":
      ans="No"
print(ans)